Created
June 26, 2019 01:09
-
-
Save romeuhcf/0c8f780bcb22275a056057bea99d4153 to your computer and use it in GitHub Desktop.
Safely remove every empty sidekiq queue.
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
redis-cli EVAL 'local n = 0 ; local qs = redis.call("smembers","queues"); for _,q in ipairs(qs) do local qname = "queue:"..q ;if redis.call("llen", qname) == 0 then redis.call("srem", "queues", q) ; redis.call("del", qname); n = n+1 end end ; return n' 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment