<commit_before>class UpdatePapers
  include Sidekiq::Worker
  MAX_AGE = 31.days

  PAPER_UPDATED_COLUMNS = {
    MendeleySearch => 'mendeley_updated',
    PlosSearch => 'plos_updated',
    Snpedia => 'snpedia_updated'
  }

  def perform
    PAPER_UPDATED_COLUMNS.each do |worker, column|
      Snp.where("#{column} < ?", max_age).pluck(:id).each do |snp_id|
        worker.perform_async(snp_id)
      end
    end
  end

  private

  def max_age
    MAX_AGE.ago
  end
end<commit_msg>fixup! Schedule updating papers once a month<commit_after>class UpdatePapers
  include Sidekiq::Worker
  MAX_AGE = 31.days

  PAPER_UPDATED_COLUMNS = {
    MendeleySearch => 'mendeley_updated',
    PlosSearch => 'plos_updated',
    Snpedia => 'snpedia_updated'
  }.freeze

  def perform
    PAPER_UPDATED_COLUMNS.each do |worker, column|
      Snp.where("#{column} < ?", max_age).pluck(:id).each do |snp_id|
        worker.perform_async(snp_id)
      end
    end
  end

  private

  def max_age
    MAX_AGE.ago
  end
end
{'fraction_non_alphanumeric': 0.10179640718562874, 'fraction_numerical': 0.003992015968063872, 'mean_word_length': 3.25, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4711008', 'n_tokens_mistral': 394, 'n_tokens_neox': 378, 'n_words': 72}