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

Allow deletion of queues from web UI [#154]

This commit is contained in:
Mike Perham 2012-05-02 20:19:59 -07:00
parent 5a18496d3b
commit 6ed1cc868f
6 changed files with 28 additions and 12 deletions

View file

@ -1,18 +1,16 @@
1.2.0 1.2.0
----------- -----------
- Error backtraces can optionally be stored as part of the retry, - Full or partial error backtraces can optionally be stored as part of the retry
for display in the web UI if you aren't using an error service. [#155] for display in the web UI if you aren't using an error service. [#155]
```ruby ```ruby
class Worker class Worker
include Sidekiq::Worker include Sidekiq::Worker
sidekiq_options :backtrace => true || 10 sidekiq_options :backtrace => [true || 10]
end end
``` ```
- Add Timeout middleware to optionally kill a worker after N seconds (blackgold9)
- Add Timeout middleware to optionally kill a worker after N seconds,
just configure like so. (blackgold9)
```ruby ```ruby
class HangingWorker class HangingWorker
@ -25,12 +23,10 @@ end
``` ```
- Fix delayed extensions not available in workers [#152] - Fix delayed extensions not available in workers [#152]
- In test environments add the `#drain` class method to workers. This method - In test environments add the `#drain` class method to workers. This method
executes all previously queued jobs. (panthomakos) executes all previously queued jobs. (panthomakos)
- Sidekiq workers can be run inline during tests, just `require 'sidekiq/testing/inline'` (panthomakos)
- Sidekiq workers can be run inline during tests by requiring the - Queues can now be deleted from the Sidekiq web UI [#154]
`sidekiq/testing/inline` file. (panthomakos)
1.1.4 1.1.4
----------- -----------

View file

@ -4,7 +4,7 @@ gemspec
gem 'slim' gem 'slim'
gem 'sprockets' gem 'sprockets'
gem 'sass' gem 'sass'
gem 'rails' gem 'rails', '3.2.3'
gem 'sqlite3' gem 'sqlite3'
group :test do group :test do

View file

@ -126,6 +126,14 @@ module Sidekiq
slim :queue slim :queue
end end
post "/queues/:name" do
Sidekiq.redis do |conn|
conn.del("queue:#{params[:name]}")
conn.srem("queues", params[:name])
end
redirect root_path
end
get "/retries/:score" do get "/retries/:score" do
halt 404 unless params[:score] halt 404 unless params[:score]
@score = params[:score].to_f @score = params[:score].to_f

View file

@ -1,6 +1,6 @@
class HardWorker class HardWorker
include Sidekiq::Worker include Sidekiq::Worker
sidekiq_options :timeout => 60 sidekiq_options :timeout => 60, :backtrace => 5, :timeout => 20
def perform(name, count, salt) def perform(name, count, salt)
raise name if name == 'crash' raise name if name == 'crash'

View file

@ -9,3 +9,11 @@ body {
background-color: #aaa; background-color: #aaa;
} }
td form {
margin: 0;
}
td form .btn {
margin: 0;
}

View file

@ -38,11 +38,15 @@
tr tr
th Queue th Queue
th Size th Size
th
- queues.each do |(queue, size)| - queues.each do |(queue, size)|
tr tr
td td
a href="queues/#{queue}" #{queue} a href="#{root_path}queues/#{queue}" #{queue}
td= size td= size
td
form action="#{root_path}queues/#{queue}" method="post"
input.btn.btn-danger type="submit" name="delete" value="Delete"
#retries.tab-pane #retries.tab-pane
table class="table table-striped table-bordered" table class="table table-striped table-bordered"