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

fix(redis example): update for partial updates #1793

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Conversation

KyleAMathews
Copy link
Contributor

@KyleAMathews KyleAMathews commented Oct 3, 2024

Fixes #1789

Copy link

netlify bot commented Oct 3, 2024

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit ff3fa98
🔍 Latest deploy log https://app.netlify.com/sites/electric-next/deploys/66fed91fc98233000940a356
😎 Deploy Preview https://deploy-preview-1793--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@samwillis samwillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just the stray console.log

Love a bit of Lua with Redis!

// Loop through each message and make writes to the Redis hash for action messages
messages.forEach((message) => {
if (!isChangeMessage(message)) return
console.log(`message`, message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left over console.log from debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I left it there on purpose actually as when playing with it it's nice to see the message log get outputted. For a production version yeah you wouldn't want it but I think it's nice for an example.

Comment on lines +41 to +42
// FIXME The Redis docs suggest only sending 10k commands at a time
// to avoid excess memory usage buffering commands.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth creating an issue for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh no. It's a very low priority for an example. It's more a note for someone taking this into production. Perhaps the first to use this at scale can update it.

@KyleAMathews KyleAMathews reopened this Oct 3, 2024
@KyleAMathews KyleAMathews merged commit c8fed1b into main Oct 3, 2024
19 of 21 checks passed
@KyleAMathews KyleAMathews deleted the fix-redis branch October 3, 2024 21:19
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.

Update Redis example to handle update operations properly
2 participants