<commit_before>require 'clockwork'
require_relative '../config/boot'
require_relative '../config/environment'

include Clockwork

# Use locks so multiple clock processes do not schedule dupes
every(1.minutes, 'clockwork.frequent') do

  if RedisLock.acquire("clockwork:feed:refresher:scheduler")
    FeedRefresherScheduler.perform_async
  end

  if RedisLock.acquire("clockwork:send_stats")
    SendStats.perform_async
  end

end

every(1.day, 'clockwork.daily', at: '12:00', tz: 'UTC') do

  if RedisLock.acquire("clockwork:delete_unread_entries")
    UnreadEntryDeleterScheduler.perform_async
  end

  if RedisLock.acquire("clockwork:delete_entries")
    # EntryDeleterScheduler.perform_async
  end

  if RedisLock.acquire("clockwork:trial_expiration")
    TrialExpiration.perform_async
  end

end<commit_msg>Version locks.<commit_after>require 'clockwork'
require_relative '../config/boot'
require_relative '../config/environment'

include Clockwork

# Use locks so multiple clock processes do not schedule dupes
every(1.minutes, 'clockwork.frequent') do

  if RedisLock.acquire("clockwork:feed:refresher:scheduler:v2")
    FeedRefresherScheduler.perform_async
  end

  if RedisLock.acquire("clockwork:send_stats:v2")
    SendStats.perform_async
  end

end

every(1.day, 'clockwork.daily', at: '12:00', tz: 'UTC') do

  if RedisLock.acquire("clockwork:delete_unread_entries:v2")
    UnreadEntryDeleterScheduler.perform_async
  end

  if RedisLock.acquire("clockwork:delete_entries:v2")
    # EntryDeleterScheduler.perform_async
  end

  if RedisLock.acquire("clockwork:trial_expiration:v2")
    TrialExpiration.perform_async
  end

end
{'fraction_non_alphanumeric': 0.10012210012210013, 'fraction_numerical': 0.010378510378510378, 'mean_word_length': 5.582329317269076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3892243', 'n_tokens_mistral': 569, 'n_tokens_neox': 542, 'n_words': 100}