lecture-attendance-manager/config/application.rb
Joshua Coles f850526a59
All checks were successful
Build and Publish Docker Container / build (push) Successful in 5m49s
Add cron jobs to good job, will run in instance with RUNNER=1 env.
2024-02-07 10:27:32 +00:00

46 lines
1.3 KiB
Ruby

require_relative "boot"
require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module LectureAttendanceManager
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
# config.active_job.queue_adapter = :sidekiq
config.active_job.queue_adapter = :good_job
config.hosts << "lectures.joshuacoles.me"
config.action_controller.forgery_protection_origin_check = false
# Disable sass to make tailwind work
config.assets.css_compressor = nil
# 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