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

Fix race conditions in Web UI actions

This commit is contained in:
Mike Perham 2013-08-15 19:52:50 -07:00
parent be6ece9a45
commit 484d35e18b
3 changed files with 25 additions and 13 deletions

View file

@ -1,3 +1,9 @@
2.13.2
-----------
- Fix more race conditions in Web UI actions
2.13.1
-----------

View file

@ -1,3 +1,3 @@
module Sidekiq
VERSION = "2.13.1"
VERSION = "2.13.2"
end

View file

@ -238,10 +238,12 @@ module Sidekiq
post "/retries/:key" do
halt 404 unless params['key']
job = Sidekiq::RetrySet.new.fetch(*parse_params(params['key'])).first
if params['retry']
job.retry
elsif params['delete']
job.delete
if job
if params['retry']
job.retry
elsif params['delete']
job.delete
end
end
redirect "#{root_path}retries"
end
@ -265,10 +267,12 @@ module Sidekiq
params['key'].each do |key|
job = Sidekiq::ScheduledSet.new.fetch(*parse_params(key)).first
if params['delete']
job.delete
elsif params['add_to_queue']
job.add_to_queue
if job
if params['delete']
job.delete
elsif params['add_to_queue']
job.add_to_queue
end
end
end
redirect "#{root_path}scheduled"
@ -277,10 +281,12 @@ module Sidekiq
post "/scheduled/:key" do
halt 404 unless params['key']
job = Sidekiq::ScheduledSet.new.fetch(*parse_params(params['key'])).first
if params['add_to_queue']
job.add_to_queue
elsif params['delete']
job.delete
if job
if params['add_to_queue']
job.add_to_queue
elsif params['delete']
job.delete
end
end
redirect "#{root_path}scheduled"
end