2024-02-10 16:18:56 -06:00
|
|
|
Rails.application.configure do
|
|
|
|
config.good_job.enable_cron = true
|
2024-04-13 09:28:45 -04:00
|
|
|
|
|
|
|
if ENV["UPGRADES_ENABLED"] == "true"
|
|
|
|
config.good_job.cron = {
|
|
|
|
auto_upgrade: {
|
|
|
|
cron: "every 30 seconds",
|
|
|
|
class: "AutoUpgradeJob",
|
|
|
|
description: "Check for new versions of the app and upgrade if necessary"
|
|
|
|
}
|
2024-02-10 16:18:56 -06:00
|
|
|
}
|
2024-04-13 09:28:45 -04:00
|
|
|
end
|
2024-10-24 17:28:29 -04:00
|
|
|
|
|
|
|
# Auth for jobs admin dashboard
|
|
|
|
ActiveSupport.on_load(:good_job_application_controller) do
|
|
|
|
before_action do
|
|
|
|
raise ActionController::RoutingError.new("Not Found") unless current_user&.super_admin?
|
|
|
|
end
|
|
|
|
|
|
|
|
def current_user
|
|
|
|
session = Session.find_by(id: cookies.signed[:session_token])
|
|
|
|
session&.user
|
|
|
|
end
|
|
|
|
end
|
2024-02-10 16:18:56 -06:00
|
|
|
end
|