diff --git a/lib/sidekiq/web.rb b/lib/sidekiq/web.rb index c74e10b7..9683eb32 100644 --- a/lib/sidekiq/web.rb +++ b/lib/sidekiq/web.rb @@ -41,7 +41,9 @@ module Sidekiq def reset_worker_list Sidekiq.redis do |conn| workers = conn.smembers('workers') - conn.srem('workers', *workers) + workers.each do |name| + conn.srem('workers', name) + end end end diff --git a/test/test_web.rb b/test/test_web.rb index fb85d32b..5d9861dc 100644 --- a/test/test_web.rb +++ b/test/test_web.rb @@ -76,6 +76,11 @@ class TestWeb < Minitest::Test end end + it 'can clear the worker list' do + post '/reset' + assert_equal 302, last_response.status + end + it 'can delete a job' do Sidekiq.redis do |conn| conn.rpush('queue:foo', "{}") @@ -191,7 +196,6 @@ class TestWeb < Minitest::Test assert_equal 200, last_response.status assert_match /#{params[0]['args'][2]}/, last_response.body end - end it 'can retry all retries' do