Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Configure notify-keyspace-events for redis #180

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

levinandrew
Copy link
Contributor

@levinandrew levinandrew commented Nov 27, 2024

Enable subscription for key updates

Terraform plan

Terraform will perform the following actions:
...
  # module.wandb.module.redis[0].google_redis_instance.default will be updated in-place
  ~ resource "google_redis_instance" "default" {
        id                       = "projects/playground-111/locations/us-central1/instances/andrew-levin-gcp-two-redis"
        name                     = "andrew-levin-gcp-two-redis"
      ~ redis_configs            = {
          + "notify-keyspace-events" = "K$"
        }
...
Plan: 0 to add, 1 to change, 0 to destroy.

Subscribing test

After applying the changes, I connected to the redis instance from two terminal windows. In one window I did

10.30.0.4:6378> PSUBSCRIBE __keyspace@0__:*
Reading messages... (press Ctrl-C to quit)
1) "psubscribe"
2) "__keyspace@0__:*"
3) (integer) 1

then in another I did

10.30.0.4:6378> SET testKey testValue
OK

then in the first window I saw the update come through

1) "pmessage"
2) "__keyspace@0__:*"
3) "__keyspace@0__:testKey"
4) "set"

@levinandrew levinandrew changed the title feat: configure notify-keyspace-events for redis feat: Configure notify-keyspace-events for redis Nov 27, 2024
@levinandrew levinandrew marked this pull request as ready for review November 27, 2024 21:52
@levinandrew levinandrew requested a review from a team as a code owner November 27, 2024 21:52
@levinandrew levinandrew merged commit e63e89f into main Nov 27, 2024
5 of 6 checks passed
@levinandrew levinandrew deleted the levinandrew/configure-notify-keyspace-events branch November 27, 2024 22:10
jsbroks pushed a commit that referenced this pull request Nov 27, 2024
## [6.2.0](v6.1.0...v6.2.0) (2024-11-27)

### Features

* Configure notify-keyspace-events for redis ([#180](#180)) ([e63e89f](e63e89f))
@jsbroks
Copy link
Member

jsbroks commented Nov 27, 2024

This PR is included in version 6.2.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants