<commit_before>require_relative 'environment' # boot up Rails
require 'clockwork'

module Clockwork
  handler do |job_name|
    job_name = job_name.gsub /(_job)?$/, '_job'
    job_class = job_name.camelize.constantize

    Process.detach fork { job_class.perform }<commit_msg>Load Rails after forking.  Saves memory at the cost of CPU time<commit_after>require 'clockwork'
#require_relative 'environment' # preload Rails

module Clockwork
  handler do |job_name|
    pid = fork do
      require_relative 'environment'

      job_name = job_name.gsub /(_job)?$/, '_job'
      job_class = job_name.camelize.constantize
      job_class.perform
    end

    Process.detach pid
{'fraction_non_alphanumeric': 0.08779761904761904, 'fraction_numerical': 0.0, 'mean_word_length': 3.841726618705036, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6387498', 'n_tokens_mistral': 220, 'n_tokens_neox': 211, 'n_words': 58}