Sidekiq: Is there API call for reseting (clearing) all history, queues, data?

Created on 26 Jul 2013  Â·  3Comments  Â·  Source: mperham/sidekiq

In my tests I use the api to check that a job was enqueued, and then clear all queues after the test.

after(:each) do
Sidekiq::Queue.new.clear
Sidekiq::RetrySet.new.clear
Sidekiq::ScheduledSet.new.clear
end

But I notice, this doesn't reset the history.

stats.processed will keep climbing up. Is there a way to just clear the entire redis store?

Most helpful comment

Sidekiq.redis { |conn| conn.flushdb }

All 3 comments

Redis has a flushdb command.

On Jul 26, 2013, at 14:48, homanchou [email protected] wrote:

In my tests I use the api to check that a job was enqueued, and then clear all queues after the test.

after(:each) do
Sidekiq::Queue.new.clear
Sidekiq::RetrySet.new.clear
Sidekiq::ScheduledSet.new.clear
end

But I notice, this doesn't reset the history.

stats.processed will keep climbing up. Is there a way to just clear the entire redis store?

—
Reply to this email directly or view it on GitHub.

How do I execute that command within an rspec after filter? Is there a way to use Sidekiq to access the redis connection so I don't have to install anything else? Similar to ActiveRecord::Base.connection.execute(sql...)

Sidekiq.redis { |conn| conn.flushdb }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

edgarjs picture edgarjs  Â·  3Comments

mperham picture mperham  Â·  4Comments

smanolloff picture smanolloff  Â·  3Comments

HenleyChiu picture HenleyChiu  Â·  4Comments

davidcelis picture davidcelis  Â·  3Comments