Do not build keys on lua scripts#348
Merged
mhenrixon merged 2 commits intomhenrixon:masterfrom Nov 19, 2018
Merged
Conversation
f01f1fe to
bea25a8
Compare
On this way users of sidekiq-unique-jobs that made use of redis-namespace < 2.0 could use it.
bea25a8 to
621f81f
Compare
mhenrixon
approved these changes
Nov 14, 2018
Owner
mhenrixon
left a comment
There was a problem hiding this comment.
At first glance it looks good. I'll have to dig into this a little deeper before but I have no objections against this.
mhenrixon
approved these changes
Nov 19, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Our one of our projects we're using redis-namespace which below 2.0 try to implicitly namespace keys transparently.
For example for script calls it does the following as an example:
https://github.com/resque/redis-namespace/blob/30d42177d8abfdf89e502c1a98aab7d923c2a133/lib/redis/namespace.rb#L372
Well, we're going to evaluate keeping using redis-namespace on the future, but we cannot afford the migration right now, and we realized that we cannot make use of the new
conflictresolution features because of this:sidekiq-unique-jobs/redis/delete_job_by_digest.lua
Line 1 in 9d1ee6c
As it's going to build a string just like
queue:defaultwhen in our redis service should beapp_name:queue:defaultSolution
We provided a slightly change so the ruby code provides which it thinks is the whole key to search for jobs then
redis-namespacewill add the namespace transparently.Please let me know what you think, maybe we should add some kind of not on README about the
redis-namespaceusage or any other thing to clarify the previous situation and if this is accepted in some way evaluate if it's correct or not.