Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
refactored some methods out
  • Loading branch information
nightshade427 authored and rbriank committed May 6, 2010
1 parent 5a3b462 commit 123488c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/delayed/backend/couch_rest.rb
Expand Up @@ -67,9 +67,9 @@ def self.find_available(worker_name, limit = 5, max_run_time = ::Delayed::Worker
jobs
end
def self.clear_locks!(worker_name)
docs = by_failed_at_and_locked_by_and_run_at :startkey => ['', worker_name], :endkey => ['', worker_name, {}]
docs.each { |doc| doc.locked_by, doc.locked_at = '', ''; }
database.bulk_save docs
jobs = my_jobs worker_name
jobs.each { |j| j.locked_by, j.locked_at = '', ''; }
database.bulk_save jobs
end
def self.delete_all
database.bulk_save all.each { |doc| doc['_deleted'] = true }
Expand Down

0 comments on commit 123488c

Please sign in to comment.