- Issue created by @o'briat
- First commit to issue fork.
- Merge request !2Issue #3379107: Simple cron should log failed manual executions. → (Merged) created by mukhtarm
- Status changed to Needs review
over 1 year ago 12:54pm 24 August 2023 - 🇫🇷France o'briat Nantes
We push simultaneously :)
Anyway the MR is ready to be RTBC
- Status changed to RTBC
over 1 year ago 8:53am 4 January 2024 - 🇫🇷France o'briat Nantes
I mark this issue as RTBTC as it run smoothly on production websites for 4 months
- Status changed to Needs work
over 1 year ago 10:05am 4 January 2024 - 🇫🇷France o'briat Nantes
I need more testing, this patch add too much logging,
CronJob::run
already log successful and failed job - 🇮🇳India abhaisasidharan
Additionally, if the Simple Cron job fails, it does not update the last run. Let me explain why this could be a potential issue.
In our project, we have a Simple Cron job that loops through a set of emails and send a notification (based on a condition: If date is 14 days from today).
This cron should execute once a day if all goes well. If the cron job fails, there is no long showing that it failed, and the last run is not updated.
The core-cron is set to run every 20 minutes. On the next core-cron run, it will check for last run time for the simple cron job that failed and will not find it and execute it again until it fails again. If it failed after sending 20 emails, and there are still 30 more to go. The first 20 emails will get repeated emails every time the core-cron runs (20 minutes).Solution:
The simple cron job, should update last run time even if it fails. The responsibility of making sure it doesn't fail belongs to the developer. - 🇬🇧United Kingdom scott_euser
Fine to create as a separate issue I think. This one is okay, but coding standards should be followed (which currently are not). Updated issue summary to reflect that.
- 🇫🇷France o'briat Nantes
Phpcs fixed, I also added two minors fixes on
CronTest.php
- 🇬🇧United Kingdom scott_euser
Thanks! CronTest.php phpcs seems like its out of scope, I don't think phpcs should be applied to existing code as part of this issue, that is getting resolved in other issues.
- 🇫🇷France o'briat Nantes
Yes, I know but with just two carriage returns all the module now complies with the Drupal standards. If you think it's not needed, I'll revert it.
- 🇬🇧United Kingdom scott_euser
Nah all good, does no harm, ignore me :) Anyways I put in an application to take over maintenance since the maintainer has been quiet for a long time now. If that does go ahead I'll get a bunch of issues merged in + test coverage running again once 📌 Automated Drupal 11 compatibility fixes for simple_cron Needs review is in
- 🇬🇧United Kingdom scott_euser
scott_euser → changed the visibility of the branch 3379107-simple-cron-should to active.
-
scott_euser →
committed 6a06d656 on 1.1.x authored by
mukhtarm →
Issue #3379107 by o'briat, scott_euser, mukhtarm, abh.ai: Simple cron...
-
scott_euser →
committed 6a06d656 on 1.1.x authored by
mukhtarm →
- 🇬🇧United Kingdom scott_euser
Thanks!
Solution:
The simple cron job, should update last run time even if it fails. The responsibility of making sure it doesn't fail belongs to the developer.P.S. If this needs a separate issue, I can create that. It's a simple one, this.
Yes if you could create a separate issue please, as may need to also update test coverage for that (I haven't properly considered whether I agree with your logic yet, but happy to consider + get opinions of others in a new issue).
Automatically closed - issue fixed for 2 weeks with no activity.