<commit_before>class Resque
  class Worker
    attr_reader :resque

    def initialize(server, *queues)
      @resque = Resque.new(server)
      @queues = queues
    end

    def work(interval = 5)
      register_signal_handlers

      loop do
        break if @shutdown

        if job = reserve
          process job
        else
          sleep interval
        end
      end
    end

    def process(job = nil)
      return unless job ||= reserve

      begin
        job.perform
      rescue Object => e
        job.fail(e, self)
      else
        job.done
      end
    end

    def register_signal_handlers<commit_msg>to_i on passed interval<commit_after>class Resque
  class Worker
    attr_reader :resque

    def initialize(server, *queues)
      @resque = Resque.new(server)
      @queues = queues
    end

    def work(interval = 5)
      register_signal_handlers

      loop do
        break if @shutdown

        if job = reserve
          process job
        else
          sleep interval.to_i
        end
      end
    end

    def process(job = nil)
      return unless job ||= reserve

      begin
        job.perform
      rescue Object => e
        job.fail(e, self)
      else
        job.done
      end
    end

    def register_signal_handlers
{'fraction_non_alphanumeric': 0.05445935280189424, 'fraction_numerical': 0.0015785319652722968, 'mean_word_length': 1.6036960985626283, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7420435', 'n_tokens_mistral': 380, 'n_tokens_neox': 365, 'n_words': 110}