Sha256: 5de9b6402edf9bdf929bd9286c552913e4fcf86778ffab3d25205b7d637584da

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

# encoding: utf-8
module Resque
  module StuckQueue
    module Signals
      extend self

      def enable!
        if Resque::StuckQueue.config[:enable_signals]

          trap("SIGUSR1") do
            ENV['SIGUSR1'] = "done be had"
            Resque::StuckQueue.logger.info("Inspecting StuckQueue config: #{Resque::StuckQueue.config.inspect}")
            Resque::StuckQueue.queues.each do |q| Resque::StuckQueue.log_watcher_info(q) end
            Resque::StuckQueue.logger.info("¯\_(ツ)_/¯ ...")
          end

          # do something meaningful
          #trap("SIGUSR2") do
          #  require 'pry'
          #  binding.pry
          #end

        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
resque_stuck_queue-0.5.1 lib/resque_stuck_queue/signals.rb
resque_stuck_queue-0.4.4 lib/resque_stuck_queue/signals.rb