Skip to content

Commit

Permalink
Schedule checks to run
Browse files Browse the repository at this point in the history
  • Loading branch information
goulvench committed Feb 17, 2025
1 parent 56ad3da commit 6de33dc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
10 changes: 10 additions & 0 deletions app/jobs/schedule_checks_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class ScheduleChecksJob< ApplicationJob
def perform
Check.to_schedule.find_each do |check|
Check.transaction do
RunCheckJob.with(check).set(wait_until: check.run_at).perform_later
check.update(scheduled: true)
end
end
end
end
22 changes: 12 additions & 10 deletions config/recurring.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# production:
# periodic_cleanup:
# class: CleanSoftDeletedRecordsJob
# queue: background
# args: [ 1000, { batch_size: 500 } ]
# schedule: every hour
# periodic_command:
# command: "SoftDeletedRecord.due.delete_all"
# priority: 2
# schedule: at 5am every day
production:
schedule_checks:
class: ScheduleChecksJob
priority: 2
queue: background
schedule: every minute

development:
schedule_audits:
class: ScheduleAuditsJob
queue: background
schedule: every minute

0 comments on commit 6de33dc

Please sign in to comment.