diff --git a/lib/sidetiq/schedulable.rb b/lib/sidetiq/schedulable.rb
index a90917f..36fc29b 100644
--- a/lib/sidetiq/schedulable.rb
+++ b/lib/sidetiq/schedulable.rb
@@ -54,8 +54,9 @@ module Sidetiq
end
private
+
def get_schedulable_keys
- Sidekiq.redis_pool.with { |r| r.keys("sidetiq:#{name}:*") }
+ %w(next last schedule_description history).map { |key| "sidetiq:#{name}:#{key}" }
end
def get_schedulable_key(key)
diff --git a/lib/sidetiq/views/locks.erb b/lib/sidetiq/views/locks.erb
index bf7320d..de15b8f 100644
--- a/lib/sidetiq/views/locks.erb
+++ b/lib/sidetiq/views/locks.erb
@@ -13,6 +13,7 @@
<%= erb File.read(File.join(view_path, '_home_nav.erb')) %>
+ <% if @locks_available %>
<% if @locks.length > 0 %>
@@ -44,7 +45,9 @@
<% else %>
No locks set.
<% end %>
-
+ <% else %>
+ KEYS command is disabled in your redis instance, lock information is not available.
+ <% end %>
diff --git a/lib/sidetiq/web.rb b/lib/sidetiq/web.rb
index e8cbba4..7987a67 100644
--- a/lib/sidetiq/web.rb
+++ b/lib/sidetiq/web.rb
@@ -13,7 +13,12 @@ module Sidetiq
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