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

Unlock queue on dequeue #3

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add a method to easily clear all locks (Resque::Plugins::Lock.clear_a…
…ll_locks)
humancopy committed Mar 21, 2012
commit ad6f9fa70cf1f7ac48e1b5899ba9fc59761ed436
4 changes: 4 additions & 0 deletions lib/resque/plugins/lock.rb
Original file line number Diff line number Diff line change
@@ -85,6 +85,10 @@ def around_perform_lock(*args)
before_dequeue_lock if lock_running?
end
end

def self.clear_all_locks
Resque.redis.keys('lock:*').collect { |x| Resque.redis.del(x) }.count
end
end
end
end