<commit_before>namespace :app do
  desc "Run scrapers that need to run once per day (this task should be called from a cron job)"
  task :auto_run_scrapers => :environment do
    scrapers = Scraper.where(auto_run: true)
    time_period = 10.minutes
    time = 0
    interval = time_period / scrapers.count
    scrapers.each do |scraper|
      ScraperAutoRunWorker.perform_in(time, scraper.id)
      time += interval
    end
    puts "Queued #{scrapers.count} scrapers to run now"<commit_msg>Only need to collect list of ids<commit_after>namespace :app do
  desc "Run scrapers that need to run once per day (this task should be called from a cron job)"
  task :auto_run_scrapers => :environment do
    scraper_ids = Scraper.where(auto_run: true).map{|s| s.id}
    interval = 10.minutes / scraper_ids.count
    time = 0
    scraper_ids.each do |scraper_id|
      ScraperAutoRunWorker.perform_in(time, scraper_id)
      time += interval
    end
    puts "Queued #{scraper_ids.count} scrapers to run now"
{'fraction_non_alphanumeric': 0.082, 'fraction_numerical': 0.006, 'mean_word_length': 3.55, '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': '1259081', 'n_tokens_mistral': 335, 'n_tokens_neox': 329, 'n_words': 106}