<commit_before>class Status < ActiveRecord::Base

  def self.new_delayed_job
    status = Status.new
    status.state = "testing"
    status.desc = "delayed_job status"
    status.save!
    if Rails.env.development?
      status.run_delayed_job
    else
      status.delay.run_delayed_job
    end
    status.wait
    status
  end

  def result
    if state == 'complete'
      "[OK]"
    else
      "ERROR"
    end
  end

  def run_delayed_job
    self.state = 'complete'
    self.save!
  end

  def wait
    start = Time.zone.now
    loop do
      reload
      break if state == 'complete' || Time.zone.now - start > 10.seconds
      # break if state == 'complete' || Time.zone.now - start > 3.seconds
      sleep(1.0/10.0)
    end
  end

end
<commit_msg>disable caching<commit_after>class Status < ActiveRecord::Base

  def self.new_delayed_job
    status = Status.new
    status.state = "testing"
    status.desc = "delayed_job status"
    status.save!
    if Rails.env.development?
      status.run_delayed_job
      # status.delay.run_delayed_job
    else
      status.delay.run_delayed_job
    end
    status.wait
    status
  end

  def result
    if state == 'complete'
      "[OK]"
    else
      "ERROR"
    end
  end

  def run_delayed_job
    self.state = 'complete'
    self.save!
  end

  def wait
    start = Time.zone.now
    Status.uncached do
      loop do
        reload
        break if state == 'complete' || Time.zone.now - start > 10.seconds
        # break if state == 'complete' || Time.zone.now - start > 3.seconds
        sleep(1.0/10.0)
      end
    end
  end

end

{'fraction_non_alphanumeric': 0.09410288582183186, 'fraction_numerical': 0.010037641154328732, 'mean_word_length': 2.0673076923076925, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4782327', 'n_tokens_mistral': 554, 'n_tokens_neox': 528, 'n_words': 131}