1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

api cleanup

This commit is contained in:
Mike Perham 2012-10-20 14:09:27 -07:00
parent 05cbc6333d
commit c4e5b52676
2 changed files with 5 additions and 1 deletions

View file

@ -29,7 +29,6 @@ module Sidekiq
end
def each(&block)
# page thru the sorted set backwards so deleting entries doesn't screw up indexing
page = 0
page_size = 50
@ -99,6 +98,10 @@ module Sidekiq
@score = score
end
def retry_at
Time.at(@score)
end
def delete
count = Sidekiq.redis do |conn|
conn.zremrangebyscore('retry', @score, @score)

View file

@ -53,6 +53,7 @@ class TestApi < MiniTest::Unit::TestCase
assert_equal 'ApiWorker', retri.klass
assert_equal 'default', retri.queue
assert_equal 'bob', retri.jid
assert_in_delta Time.now.to_f, retri.retry_at.to_f, 0.01
end
it 'can delete retries' do