lib/sidetiq/web.rb in sidetiq-0.6.1 vs lib/sidetiq/web.rb in sidetiq-0.6.2
- old
+ new
@@ -11,10 +11,15 @@
@time = Sidetiq.clock.gettime
erb File.read(File.join(VIEWS, 'sidetiq.erb')), locals: {view_path: VIEWS}
end
app.get "/sidetiq/locks" do
- @locks = Sidetiq::Lock::Redis.all.map(&:meta_data)
+ begin
+ @locks = Sidetiq::Lock::Redis.all.map(&:meta_data)
+ @locks_available = true
+ rescue Redis::CommandError
+ @locks_available = false
+ end
erb File.read(File.join(VIEWS, 'locks.erb')), locals: {view_path: VIEWS}
end
app.get "/sidetiq/:name/schedule" do