From f850526a5913a36dd82c4ccafa2544e3abe23ae6 Mon Sep 17 00:00:00 2001 From: Joshua Coles Date: Wed, 7 Feb 2024 10:27:32 +0000 Subject: [PATCH] Add cron jobs to good job, will run in instance with `RUNNER=1` env. --- config/application.rb | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/config/application.rb b/config/application.rb index d700150..f03df40 100644 --- a/config/application.rb +++ b/config/application.rb @@ -20,12 +20,26 @@ module LectureAttendanceManager # Disable sass to make tailwind work config.assets.css_compressor = nil - # Configuration for the application, engines, and railties goes here. - # - # These settings can be overridden in specific environments using the files - # in config/environments, which are processed later. - # - # config.time_zone = "Central Time (US & Canada)" - # config.eager_load_paths << Rails.root.join("extras") + # Good Job Cron Jobs + + # Enable cron in this process + config.good_job.enable_cron = ENV['RUNNER'].present? && ENV['RUNNER'] == '1' + + # Configure cron with a hash that has a unique key for each recurring job + config.good_job.cron = { + lecture_checkin_job: { + cron: '14 * * * 1,2,3,4,5', + class: 'LectureCheckinJob', + }, + # TODO: Uncomment when Panopto is used again + # scrape_panopto_job: { + # cron: '* * * * 1,2,3,4,5', + # class: 'ScrapePanoptoJob', + # }, + scrape_toggl_job: { + cron: '10 * * * 1,2,3,4,5', + class: 'ScrapeTogglJob', + }, + } end end