<commit_before>namespace :summary do
  desc "Generate validation summary"
  task :generate => :environment do
    summary = Summary.generate
    summary.save!
  end  
end<commit_msg>Use delayed_job to requeue summary the following day<commit_after>namespace :summary do
  desc "Generate validation summary"
  task :generate => :environment do
    GenerateSummary.perform
  end
end

class GenerateSummary
  def self.perform
    summary = Summary.generate
    summary.save!
    Delayed::Job.enqueue GenerateSummary, run_at: 1.day.from_now
  end
end
{'fraction_non_alphanumeric': 0.06776556776556776, 'fraction_numerical': 0.0018315018315018315, 'mean_word_length': 4.20952380952381, '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': '2061353', 'n_tokens_mistral': 153, 'n_tokens_neox': 151, 'n_words': 49}