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

Use unlink, not del, for performance #4449

Merged
merged 2 commits into from Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Changes.md
Expand Up @@ -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`. [#4449]

6.0.4
---------
Expand Down
4 changes: 2 additions & 2 deletions lib/sidekiq/api.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/sidekiq/launcher.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down