lib/sidekiq/expected_failures/web.rb in sidekiq-expected_failures-0.2.5 vs lib/sidekiq/expected_failures/web.rb in sidekiq-expected_failures-0.3.0
- old
+ new
@@ -20,18 +20,13 @@
redirect "#{root_path}expected_failures"
end
app.get "/expected_failures/stats" do
- @counters = Sidekiq::ExpectedFailures.counters
-
- content_type :json
- Sidekiq.dump_json({
- failures: @counters
- })
+ json(failures: Sidekiq::ExpectedFailures.counters)
end
- app.get "/expected_failures/?:date?" do
+ app.get "/expected_failures" do
@dates = Sidekiq::ExpectedFailures.dates
@count = (params[:count] || 50).to_i
if @dates
@date = params[:date] || @dates.keys[0]