<commit_before>require 'say_when'

# Specify a logger for SayWhen
SayWhen.logger = Rails.logger

# Configure the scheduler for how to store and process scheduled jobs
# it will default to a :memory strategy and :simple processor
SayWhen.configure do |options|
  options[:processor_strategy] = :active_job
  options[:queue] = :cms_default

  options[:storage_strategy] = :active_record
  options[:store_executions] = false
  options[:table_prefix] = 'cms_'
end

begin
  SayWhen.schedule(
    group: 'application',
    name: 'check_published',
    trigger_strategy: 'cron',
    trigger_options: { expression: '0 0/5 * * * ?', time_zone: 'UTC' },
    job_class: 'Distribution',
    job_method: 'check_published!'
  )
rescue ActiveRecord::StatementInvalid => ex
  puts "Failed to init say_when job: #{ex.inspect}"
end

begin
  SayWhen.schedule(
    group: 'application',
    name: 'check_imported',
    trigger_strategy: 'cron',
    trigger_options: { expression: '0 0/5 * * * ?', time_zone: 'UTC' },
    job_class: 'Distribution',
    job_method: 'check_imported!'
  )
rescue ActiveRecord::StatementInvalid => ex
  puts "Failed to init say_when job: #{ex.inspect}"<commit_msg>Point say_when at correct SQS<commit_after>require 'say_when'

# Specify a logger for SayWhen
SayWhen.logger = Rails.logger

# Configure the scheduler for how to store and process scheduled jobs
# it will default to a :memory strategy and :simple processor
SayWhen.configure do |options|
  options[:processor_strategy] = :active_job
  options[:queue] = ENV['SQS_DEFAULT_QUEUE_NAME']

  options[:storage_strategy] = :active_record
  options[:store_executions] = false
  options[:table_prefix] = 'cms_'
end

begin
  SayWhen.schedule(
    group: 'application',
    name: 'check_published',
    trigger_strategy: 'cron',
    trigger_options: { expression: '0 0/5 * * * ?', time_zone: 'UTC' },
    job_class: 'Distribution',
    job_method: 'check_published!'
  )
rescue ActiveRecord::StatementInvalid => ex
  puts "Failed to init say_when job: #{ex.inspect}"
end

begin
  SayWhen.schedule(
    group: 'application',
    name: 'check_imported',
    trigger_strategy: 'cron',
    trigger_options: { expression: '0 0/5 * * * ?', time_zone: 'UTC' },
    job_class: 'Distribution',
    job_method: 'check_imported!'
  )
rescue ActiveRecord::StatementInvalid => ex
  puts "Failed to init say_when job: #{ex.inspect}"
{'fraction_non_alphanumeric': 0.11979823455233292, 'fraction_numerical': 0.005044136191677175, 'mean_word_length': 4.626477541371158, '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': '101799', 'n_tokens_mistral': 780, 'n_tokens_neox': 762, 'n_words': 205}