Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
evanwhalen authored and defunkt committed Sep 23, 2011
1 parent ad8c332 commit 05b579b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/resque/failure.rb
Expand Up @@ -67,6 +67,8 @@ def self.remove(index)
backend.remove(index)
end

# Requeues all failed jobs in a specific queue.
# Queue name should be a string.
def self.requeue_queue(queue)
i=0
while job = Resque::Failure.all(i)
Expand All @@ -77,11 +79,13 @@ def self.requeue_queue(queue)
end
end

# Removes all failed jobs in a specific queue.
# Queue name should be a string.
def self.remove_queue(queue)
i=0
while job = Resque::Failure.all(i)
if job['queue'] == queue
# This will remove from the queue so don't increment the index
# This will remove the failure from the array so do not increment the index.
Resque::Failure.remove(i)
else
i+=1
Expand Down

0 comments on commit 05b579b

Please sign in to comment.