-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Scheduled jobs: add status message if cron not running #17819
Conversation
(Standard links)
|
c6f5b9e
to
d661f93
Compare
@agh1 Bravo! This is perfect. message appears where it's needed. I did an |
Very form-layer so OK without a test. Based on @kcristiano r-run MOP |
I'm actually working on a PR right now that would allow you to run specific checks instead of the current all-or-nothing approach. $status = \Civi\Api4\System::check()->addWhere('name', '=', 'checkLastCron')->execute(); The only difference between the output of that check and what you've done here is the wording of the messages, and I would argue your wording is better and should be what the system check says. So if you don't mind waiting a bit for my PR, we can do this a little more cleanly. |
@colemanw that sounds useful from a lot of perspectives. Is the result from that APIv4 check something distinct from the wording and severity that comes from the check? My concern is that on the first day the site is live we'd want to retain the new kinder, gentler "notice" on the system check but have an unambiguous message on the Scheduled Jobs page that nothing's going to run because the cron job isn't working. My other concern with relying on checks to drive other parts of the UI is that this could make it more brittle. Let's say @kcristiano has a change of heart and says, "You know, go big or go home: cron not running should be an To resolve this, I wonder if we could take a page from Icinga2 and return some data points from checks. Maybe the output of the check via API might be along the lines of: [
'name' => 'checkLastCron',
'message' => 'Last cron run at July 13th, 2020 5:31 PM. To enable scheduling support, please set up the cron job.',
'title' => 'Cron Not Running',
'severity' => 'warning',
'severity_id' => 3,
'is_visible' => 1,
'icon' => 'fa-clock-o',
'id' => 3,
'data' => [
'lastrun' => 1594675860,
'new' => FALSE,
],
] The Finally, just a note: the APIv4 method should probably retrieve the cached result with an option to force-check, which we'd want to use in the case of the Scheduled Jobs page since it's a cheap test and someone might want to refresh the page to confirm it's working. |
We might be able to punt the data points for now because I think this will work fine regardless of the severity getting escalated. The wording can be the same in both contexts; the "grace period" softness comes from a reduced severity, not from alternate wording. I would suggest:
|
I'm not sure what you mean here. StatusCheck results aren't cached anywhere, ever, to my knowledge. |
@colemanw it seems at least there was an attempt at caching status checks as per https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Invoke.php#L356 |
That just caches a single integer value: |
@colemanw @seamuslee001 yeah now I remember more. The maxSeverity is cached because that's the only thing that's repeatedly retrieved (to show the status in the footer of each page). The thought was that if you're viewing the actual status page or retrieving the status via API you should get fresh results each time because you're proactively going there to look. I recall @eileenmcnaughton saying there were some checks that have a big performance hit and maybe shouldn't run except periodically. I don't know what the resolution of that was, but I suspect there may be other intensive checks that shouldn't run every time you get the status. I can think of two ways to handle that:
|
Judging by the quantity of tabs open to civicrm-core PRs on my computer, I think we may be getting into a scope problem. Here's what I propose:
I don't want the perfect to be the enemy of the good, and while I hope the third step will be easily doable this month, I could see someone having technical or wording concerns. |
I'm ok with merging this and then following up once #17824 is merged. I think that other PR is merge-ready and the bottleneck is our reviewer's time. |
@agh1 I think this can be MOP based on re-reading it. It does need a rebase though |
I just tried the web ui for resolving conflicts but I don't think the commit history will come out very clean this way & jenkins hates it |
Here's a reviewer's cut using the new API method: #18065 |
Overview
Following discussion on #17800 this adds a pop-up on the Scheduled Jobs page if cron does not appear to be running.
Before
You can go to the Scheduled Jobs page and enable things and wonder why they aren't running.
After
Technical Details
I also updated a few links to the Managing Scheduled Jobs documentation to use the new docs URL rather than the old wiki page name.