1
0
Fork 0
mirror of https://github.com/endofunky/sidetiq.git synced 2022-11-09 13:53:30 -05:00

Merge branch 'dont-use-redis-keys' of https://github.com/Connorhd/sidetiq into Connorhd-dont-use-redis-keys

Conflicts:
	lib/sidetiq/schedulable.rb
This commit is contained in:
Tobias Svensson 2014-09-22 12:28:37 +01:00
commit 1d6a20706f
3 changed files with 12 additions and 3 deletions

View file

@ -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)

View file

@ -13,6 +13,7 @@
<%= erb File.read(File.join(view_path, '_home_nav.erb')) %>
<div class="col-md-9">
<% if @locks_available %>
<% if @locks.length > 0 %>
<table class="table table-striped table-bordered table-white table-sidetiq">
<thead>
@ -44,7 +45,9 @@
<% else %>
<div class="alert alert-success">No locks set.</div>
<% end %>
</div>
<% else %>
<div class="alert alert-danger">KEYS command is disabled in your redis instance, lock information is not available.</div>
<% end %>
</div>
</div>

View file

@ -13,7 +13,12 @@ module Sidetiq
end
app.get "/sidetiq/locks" do
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