Sha256: 4739d9e34d2b55e778d8a97adf8ab4e232d49c9fcf6e9a56804137845b9562db

Contents?: true

Size: 653 Bytes

Versions: 7

Compression:

Stored size: 653 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} force to #{sig} self (pid: #{pid}) alive: #{alive_sec} sec (trial #{kill_attempts})"
          Process.kill sig, pid
          return
        end

        dj.stop

        return if sig != :TERM

        if @termination
          logger.warn "#{self} 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

7 entries across 7 versions & 1 rubygems

Version Path
worker_killer-1.0.2.187732 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.1.83603 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.1.75538 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.1.39842 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.0.39841 lib/worker_killer/killer/delayed_job.rb
worker_killer-1.0.0.39839 lib/worker_killer/killer/delayed_job.rb
worker_killer-0.1.1.39838 lib/worker_killer/killer/delayed_job.rb