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
-----------
- 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]
```ruby
class Worker
include Sidekiq::Worker
sidekiq_options :backtrace => true || 10
sidekiq_options :backtrace => [true || 10]
end
```
- Add Timeout middleware to optionally kill a worker after N seconds,
just configure like so. (blackgold9)
- Add Timeout middleware to optionally kill a worker after N seconds (blackgold9)
```ruby
class HangingWorker
@ -25,12 +23,10 @@ end
```
- Fix delayed extensions not available in workers [#152]
- In test environments add the `#drain` class method to workers. This method
executes all previously queued jobs. (panthomakos)
- Sidekiq workers can be run inline during tests by requiring the
`sidekiq/testing/inline` file. (panthomakos)
- Sidekiq workers can be run inline during tests, just `require 'sidekiq/testing/inline'` (panthomakos)
- Queues can now be deleted from the Sidekiq web UI [#154]
1.1.4
-----------

View file

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

View file

@ -126,6 +126,14 @@ module Sidekiq
slim :queue
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
halt 404 unless params[:score]
@score = params[:score].to_f

View file

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

View file

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

View file

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