Sha256: 9d2479cf28cc164a1d0249a394c9b2bd78827f945854bfb9fea8d422b82b4bc0

Contents?: true

Size: 809 Bytes

Versions: 9

Compression:

Stored size: 809 Bytes

Contents

module WorkerKiller
  module Killer
    class DelayedJob < ::WorkerKiller::Killer::Base

      def do_kill(sig, pid, alive_sec, dj:, **_params)
        if sig == :KILL
          logger.error "#{self.class}: force to #{sig} self (pid: #{pid}) alive: #{alive_sec} sec (trial #{kill_attempts})"
          Process.kill sig, pid
          return
        end

        dj.stop
        logger.info "#{self.class}: try to stop DelayedJob due to #{sig} self (pid: #{pid}) alive: #{alive_sec} sec (trial #{kill_attempts})"

        return if sig != :TERM

        if @termination
          logger.warn "#{self.class}: force to #{sig} self (pid: #{pid}) alive: #{alive_sec} sec (trial #{kill_attempts})"
          Process.kill sig, pid
        else
          @termination = true
        end
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
worker_killer-1.1.0.223443 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.1.0.214159 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.1.0.214146 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.5.213977 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.5.213889 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.4.189871 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.3.189564 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.3.189098 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.2.187852 lib/worker_killer/killer/delayed_job.rb