Skip to content

Commit

Permalink
Do not build keys on lua scripts
Browse files Browse the repository at this point in the history
On this way users of sidekiq-unique-jobs that made use of redis-namespace < 2.0 could use it.
  • Loading branch information
Paco Guzmán committed Nov 13, 2018
1 parent 9d1ee6c commit bea25a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/sidekiq_unique_jobs/on_conflict/replace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def call(&block)

# Delete the job from either schedule, retry or the queue
def delete_job_by_digest
Scripts.call(:delete_job_by_digest, nil, keys: [queue, unique_digest])
Scripts.call(:delete_job_by_digest, nil, keys: ["queue:#{queue}"], argv: [unique_digest])
end

# Delete the keys belonging to the job
Expand Down
4 changes: 2 additions & 2 deletions redis/delete_job_by_digest.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local queue = "queue:" .. KEYS[1]
local unique_digest = KEYS[2]
local queue = KEYS[1]
local unique_digest = ARGV[1]

local function delete_from_sorted_set(name, digest)
local per = 50
Expand Down

0 comments on commit bea25a8

Please sign in to comment.