From 67603bdbd70fbf41d1cdf08ef19a57525641d333 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Wed, 5 Feb 2020 14:02:15 -0800 Subject: [PATCH 1/2] Use `unlink`, not `del`, for performance --- Changes.md | 1 + lib/sidekiq/api.rb | 4 ++-- lib/sidekiq/launcher.rb | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changes.md b/Changes.md index de5a411bb..a76fea7e3 100644 --- a/Changes.md +++ b/Changes.md @@ -6,6 +6,7 @@ HEAD --------- - Fix broken Web UI response when using NewRelic and Rack 2.1.2+. [#4440] +- Update APIs to use `UNLINK`, not `DEL`. 6.0.4 --------- diff --git a/lib/sidekiq/api.rb b/lib/sidekiq/api.rb index 1355253da..0c59bd35c 100644 --- a/lib/sidekiq/api.rb +++ b/lib/sidekiq/api.rb @@ -273,7 +273,7 @@ def find_job(jid) def clear Sidekiq.redis do |conn| conn.multi do - conn.del(@rname) + conn.unlink(@rname) conn.srem("queues", name) end end @@ -562,7 +562,7 @@ def scan(match, count = 100) def clear Sidekiq.redis do |conn| - conn.del(name) + conn.unlink(name) end end alias_method :💣, :clear diff --git a/lib/sidekiq/launcher.rb b/lib/sidekiq/launcher.rb index 8d8802f6f..e72805ce5 100644 --- a/lib/sidekiq/launcher.rb +++ b/lib/sidekiq/launcher.rb @@ -83,7 +83,7 @@ def clear_heartbeat Sidekiq.redis do |conn| conn.pipelined do conn.srem("processes", identity) - conn.del("#{identity}:workers") + conn.unlink("#{identity}:workers") end end rescue @@ -118,7 +118,7 @@ def ❤ conn.incrby("stat:failed:#{nowdate}", fails) conn.expire("stat:failed:#{nowdate}", STATS_TTL) - conn.del(workers_key) + conn.unlink(workers_key) curstate.each_pair do |tid, hash| conn.hset(workers_key, tid, Sidekiq.dump_json(hash)) end From e9921d943242b7f0781037e5abe9fd1af7902f66 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Wed, 5 Feb 2020 14:04:12 -0800 Subject: [PATCH 2/2] issue no. --- Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index a76fea7e3..ed27b573d 100644 --- a/Changes.md +++ b/Changes.md @@ -6,7 +6,7 @@ HEAD --------- - Fix broken Web UI response when using NewRelic and Rack 2.1.2+. [#4440] -- Update APIs to use `UNLINK`, not `DEL`. +- Update APIs to use `UNLINK`, not `DEL`. [#4449] 6.0.4 ---------