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

Don't try to connect to redis from client-side sidekiq.

This commit is contained in:
Tobias Svensson 2014-09-24 09:53:53 +01:00
parent 3bd3524f4e
commit 0fd791ed2c

View file

@ -42,12 +42,14 @@ module Sidetiq
schedule.set_options(options)
# deleting schedulable keys if schedule changed since last reccurence definition
old_description = get_schedulable_key("schedule_description")
if old_description != schedule.to_s
get_schedulable_keys.map do |key|
Sidekiq.redis_pool.with { |r| r.del(key) }
if Sidekiq.server?
old_description = get_schedulable_key("schedule_description")
if old_description != schedule.to_s
get_schedulable_keys.map do |key|
Sidekiq.redis_pool.with { |r| r.del(key) }
end
set_schedulable_key("schedule_description", schedule.to_s)
end
set_schedulable_key("schedule_description", schedule.to_s)
end
end