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:
parent
be6ece9a45
commit
484d35e18b
3 changed files with 25 additions and 13 deletions
|
@ -1,3 +1,9 @@
|
|||
2.13.2
|
||||
-----------
|
||||
|
||||
- Fix more race conditions in Web UI actions
|
||||
|
||||
|
||||
2.13.1
|
||||
-----------
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module Sidekiq
|
||||
VERSION = "2.13.1"
|
||||
VERSION = "2.13.2"
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue