<commit_before>require "demon/base"

class Demon::Sidekiq < Demon::Base

  def self.prefix
    "sidekiq"
  end

  private

  def suppress_stdout
    false
  end

  def suppress_stderr
    false
  end

  def after_fork
    STDERR.puts "Loading Sidekiq in process id #{Process.pid}"
    require 'sidekiq/cli'
    cli = Sidekiq::CLI.instance
    cli.parse(["-c", GlobalSetting.sidekiq_workers.to_s])

    load Rails.root + "config/initializers/sidekiq.rb"<commit_msg>BUGFIX: Sidekiq could be initialized incorrectly in some cases<commit_after>require "demon/base"

class Demon::Sidekiq < Demon::Base

  def self.prefix
    "sidekiq"
  end

  private

  def suppress_stdout
    false
  end

  def suppress_stderr
    false
  end

  def after_fork
    STDERR.puts "Loading Sidekiq in process id #{Process.pid}"
    require 'sidekiq/cli'
    # CLI will close the logger, if we have one set we can be in big
    # trouble, if STDOUT is closed in our process all sort of weird
    # will ensue, resetting the logger ensures it will reinit correctly
    # parent process is in charge of the file anyway.
    Sidekiq::Logging.logger = nil
    cli = Sidekiq::CLI.instance
    cli.parse(["-c", GlobalSetting.sidekiq_workers.to_s])

    load Rails.root + "config/initializers/sidekiq.rb"
{'fraction_non_alphanumeric': 0.08241758241758242, 'fraction_numerical': 0.0, 'mean_word_length': 3.278523489932886, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5680917', 'n_tokens_mistral': 440, 'n_tokens_neox': 414, 'n_words': 127}