Rename PreviewGenerationMonitor

This commit is contained in:
Justin Edmund 2025-01-18 11:45:20 -08:00
parent c49ffa6445
commit e00f8a49d9
2 changed files with 6 additions and 5 deletions

View file

@ -1,6 +1,7 @@
# app/services/preview_generation_monitor.rb
require 'sidekiq/api'
module PreviewService
class PreviewGenerationMonitor
class GenerationMonitor
class << self
def check_stalled_jobs
Party.where(preview_state: :queued)

View file

@ -5,14 +5,14 @@ unless defined?(Rails::Console) || Rails.env.test? || File.split($0).last == 'ra
scheduler = Rufus::Scheduler.new
scheduler.every '5m' do
PreviewGenerationMonitor.check_stalled_jobs
PreviewService::GenerationMonitor.check_stalled_jobs
end
scheduler.every '1h' do
PreviewGenerationMonitor.retry_failed
PreviewService::GenerationMonitor.retry_failed
end
scheduler.every '1d' do
PreviewGenerationMonitor.cleanup_old_previews
PreviewService::GenerationMonitor.cleanup_old_previews
end
end