Sha256: 78c9bf06d5d4defb3b677de4afa464b25376e37ff1e08e37c724f0b1cac23809
Contents?: true
Size: 776 Bytes
Versions: 1
Compression:
Stored size: 776 Bytes
Contents
# frozen_string_literal: true module WorkerKiller module Killer # Gracefully kills rufus scheduler. class RufusScheduler < ::WorkerKiller::Killer::Base # rubocop:disable Metrics/ParameterLists # @param scheduler [Rufus::Scheduler] # @param timeout [Integer] def do_kill(sig, pid, alive_sec, scheduler:, timeout:, **_params) # rubocop:enable Metrics/ParameterLists if sig == :KILL logger.error { "#{self} force to #{sig} self (pid: #{pid}) alive: #{alive_sec} sec" } scheduler.shutdown(:kill) return end logger.warn { "#{self} run #{sig} self (pid: #{pid}) alive: #{alive_sec} sec, timeout: #{timeout} sec" } scheduler.shutdown(wait: timeout) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
worker_killer-rufus_scheduler-1.0.1 | lib/worker_killer/killer/rufus_scheduler.rb |