module Sqeduler::Worker::KillSwitch::ClassMethods

rubocop:disable Style/Documentation

Public Instance Methods

disable() click to toggle source
# File lib/sqeduler/worker/kill_switch.rb, line 30
def disable
  Service.redis_pool.with do |redis|
    redis.hset(SIDEKIQ_DISABLED_WORKERS, name, Time.now)
    Service.logger.warn "#{name} has been disabled"
  end
end
disabled?() click to toggle source
# File lib/sqeduler/worker/kill_switch.rb, line 37
def disabled?
  Service.redis_pool.with do |redis|
    redis.hexists(SIDEKIQ_DISABLED_WORKERS, name)
  end
end
enable() click to toggle source
# File lib/sqeduler/worker/kill_switch.rb, line 23
def enable
  Service.redis_pool.with do |redis|
    redis.hdel(SIDEKIQ_DISABLED_WORKERS, name)
    Service.logger.warn "#{name} has been enabled"
  end
end
enabled?() click to toggle source
# File lib/sqeduler/worker/kill_switch.rb, line 43
def enabled?
  !disabled?
end