-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cron dashboard does not distinguish enabled/disabled jobs #1552
Comments
hmmmm. It looks to me like both the dashboard and the cron-functionality itself use
Are you using the same environment variables injected into the web process that's serving the dashboard as you are the process running cron? btw, you can use |
Thanks for taking a look! :) This is in my local development environment where none of the jobs are enabled, so there are no ENV vars set. I also confirmed this in our staging env where none of the jobs are enabled either and the dashboard looks the same: jobs say they're going to execute in X minutes/hours, but they do not execute (which is right!). So the actual behaviour is correct, it's just that the dashboard is a bit misleading. Confirmed at the console:
To eliminate all the complexity I shared there, here's a much simpler setup that has the same result where the dashboard says they'll execute in a minute. Rails.application.configure do
config.good_job.enable_cron = true
config.good_job.cron = {
noop1: { cron: "every minute", class: "Jobs::Base", enabled_by_default: false },
noop2: { cron: "every minute", class: "Jobs::Base", enabled_by_default: -> { false } }
}
end
Yeahhhh...I'm not a huge fan of this coercer's behaviour. It treats any unknown value as |
Ohhhh! I might be overthinking it because it might just be a display problem unrelated to the values themselves. It might be a simple fix to the View Looking at your screenshot (sorry, haven't had a chance to use code example) I see it shows the "Play" icon, meaning the current status (at least for that column) is disabled. |
Oh man, I didn't even notice that. I definitely knew the So that's good to know that that's the UI indicator! :) |
I'm running Good Job v4.5.0
In my configuration we have jobs that only run in certain environments. Previously we handled this by building the
config.good_job.cron
hash when the app boots. I recently had a problem that required me to start testing job config. I only just now noticed the relatively newenabled_by_default
option. Perfect!I switched out configuration over and it all works, but the dashboard does not distinguish enabled from disabled jobs and it makes it seem like they're going to execute. Based on my reading of the docs and this issue, it sounds like it should be?
I added a job with
enabled_by_default: false
and it looks like this:FWIW this is what the config is like. It all works as it should, the only issue is the dashboard.
The text was updated successfully, but these errors were encountered: