2024-10-29 06:52:23 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2022-04-06 14:46:10 -04:00
|
|
|
# Load the Rails application.
|
2024-10-29 06:52:23 -04:00
|
|
|
require_relative 'application'
|
2022-04-06 14:46:10 -04:00
|
|
|
|
|
|
|
|
# Initialize the Rails application.
|
|
|
|
|
Rails.application.initialize!
|
2024-10-29 06:52:23 -04:00
|
|
|
|
2025-01-07 09:02:35 -05:00
|
|
|
# Use an atomic operation to ensure one-time execution
|
|
|
|
|
if defined?(Rails::Server) && Rails.cache.write('cache_jobs_scheduled', true, unless_exist: true)
|
|
|
|
|
# Clear the cache
|
|
|
|
|
Cache::CleaningJob.perform_later
|
2024-10-29 06:52:23 -04:00
|
|
|
|
2025-01-07 09:02:35 -05:00
|
|
|
# Preheat the cache
|
|
|
|
|
Cache::PreheatingJob.perform_later
|
|
|
|
|
end
|