<commit_before>class ReindexingJob

  @@my_yaml = ReindexingJob.new.to_yaml

  def perform
    todo = ReindexingQueue.find(:all).collect do |queued|
      todo = queued.item
      queued.destroy
      todo
    end
    todo.uniq.each do |item|
      item.solr_index!
    end
  end

  def add_items_to_queue items, t=1.seconds.from_now
    items = Array(items)
    disable_authorization_checks do
      items.uniq.each do |item|
        ReindexingQueue.create :item=>item
      end
    end
    Delayed::Job.enqueue(ReindexingJob.new, 1, t) unless ReindexingJob.exists?
  end

  def self.exists?
    Delayed::Job.find(:first,:conditions=>['handler = ? AND locked_at IS ?',@@my_yaml,nil]) != nil
  end
end<commit_msg>add_items_to_queue on reindexerjob should be class method<commit_after>class ReindexingJob

  @@my_yaml = ReindexingJob.new.to_yaml

  def perform
    todo = ReindexingQueue.find(:all).collect do |queued|
      todo = queued.item
      queued.destroy
      todo
    end
    todo.uniq.each do |item|
      item.solr_index!
    end
  end

  def self.add_items_to_queue items, t=1.seconds.from_now
    items = Array(items)
    disable_authorization_checks do
      items.uniq.each do |item|
        ReindexingQueue.create :item=>item
      end
    end
    Delayed::Job.enqueue(ReindexingJob.new, 1, t) unless ReindexingJob.exists?
  end

  def self.exists?
    Delayed::Job.find(:first,:conditions=>['handler = ? AND locked_at IS ?',@@my_yaml,nil]) != nil
  end
end
{'fraction_non_alphanumeric': 0.1023728813559322, 'fraction_numerical': 0.002711864406779661, 'mean_word_length': 3.122905027932961, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5493724', 'n_tokens_mistral': 528, 'n_tokens_neox': 517, 'n_words': 109}