Sha256: 1fa29d306d7cd89aa9c733018b25e994fe29afdd291aae0f04a1b9353458a2b6
Contents?: true
Size: 651 Bytes
Versions: 9
Compression:
Stored size: 651 Bytes
Contents
module Resqutils # Can be queued to kill a worker. By default, will be queued to the 'worker_killer_job' queue, however # you can specify RESQUTILS_WORKER_KILLER_JOB_QUEUE in the environment to set an override. Of course, you can always # forcibly enqueue it as needed. class WorkerKillerJob def self.queue @queue ||= begin queue = String(ENV["RESQUTILS_WORKER_KILLER_JOB_QUEUE"]).strip queue.length == 0 ? :worker_killer_job : queue end end def self.perform(worker_id) Resque.workers.select { |_| _.id == worker_id }.each(&:unregister_worker) end end end
Version data entries
9 entries across 9 versions & 1 rubygems