Created
October 4, 2012 14:32
-
-
Save blasterpal/3833891 to your computer and use it in GitHub Desktop.
Backup Sidekiq queue entries to disk
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
| @conn = Sidekiq.redis {|conn| @conn = conn} | |
| @conn.smembers('queues').each {|q| | |
| File.open("/home/rails/#{q}_sidekiq.dump",'w') {|f| | |
| l = @conn.lrange("queue:#{q}",0,-1) | |
| f << l | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment