-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Resumable scheduled tasks #36708
Resumable scheduled tasks #36708
Conversation
I have tested this item ✅ successfully on b7d170b Nice feature This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36708. |
Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: Brian Teeman <[email protected]>
@tecpromotion Cheers! And thank you ever so much for the test! @brianteeman Thank you for the comment language fixes :) |
@nikosdion I've allowed myself to apply the change suggestion for "impending". I've also restored the previous test result because all changes after that were only in code comments. |
@nikosdion Ah, and I was so free to remove the emoji from the PR description. We made bad experience with that in past. |
I have tested this item ✅ successfully on d354d27 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36708. |
Co-authored-by: Richard Fath <[email protected]>
…esumable-mod-1 [CMS PR 36708] Revert use DateInterval
@richard67 Can I ask an incidental question? You said “[...] remove the emoji from the PR description. We made bad experience with that in past”. Um... What kind of bad experience? I have used Emojis before. It sounds like there's a story to be told here. What have I missed? |
In past sometimes emojis in the title or the first so and so many characters ot the description was able to confuse the issue tracker, as far as I remember, and it also could cause Drone or Appveyor not being started, something like that. I saw that Drone had not been started long time after the last commit, so I removed the emoji to be safe. |
I have tested this item ✅ successfully on 9962baf This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36708. |
Dang! I would have never thought an emoji would throw a spanner in the works like that. Thanks for the heads up. I'll just use text smileys from now on. |
Restored @tecpromotion 's test result since the changes after that were just doc bloc and reverting an unrelated change (which I just have tested). |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36708. |
Awesome, thx |
joomla/joomla-cms#30522 + joomla/joomla-cms#32223 + joomla/joomla-cms#31675 + joomla/joomla-cms#35378 + joomla/joomla-cms#35612 + joomla/joomla-cms#35715 + joomla/joomla-cms#35610 + joomla/joomla-cms#35607 + joomla/joomla-cms#35788 + joomla/joomla-cms#35647 + joomla/joomla-cms#35143 + joomla/joomla-cms#36135 + joomla/joomla-cms#35998 + joomla/joomla-cms#36173 + joomla/joomla-cms#36212 + joomla/joomla-cms#36208 + joomla/joomla-cms#36206 + joomla/joomla-cms#36205 + joomla/joomla-cms#36203 + joomla/joomla-cms#36192 + joomla/joomla-cms#36191 + joomla/joomla-cms#36228 + joomla/joomla-cms#36211 + joomla/joomla-cms#36271 + joomla/joomla-cms#36270 + joomla/joomla-cms#36245 + joomla/joomla-cms#36294 + joomla/joomla-cms#36244 + joomla/joomla-cms#36242 + joomla/joomla-cms#36296 + joomla/joomla-cms#36190 + joomla/joomla-cms#36474 + joomla/joomla-cms#36297 + joomla/joomla-cms#36480 + joomla/joomla-cms#36479 + joomla/joomla-cms#36551 + joomla/joomla-cms#36366 + joomla/joomla-cms#36589 + joomla/joomla-cms#36583 + joomla/joomla-cms#36328 + joomla/joomla-cms#36515 + joomla/joomla-cms#36555 + joomla/joomla-cms#36653 + joomla/joomla-cms#36660 + joomla/joomla-cms#36657 + joomla/joomla-cms#36637 + joomla/joomla-cms#35983 + joomla/joomla-cms#36704 + joomla/joomla-cms#36708 + joomla/joomla-cms#36700 +
Pull Request for Issue joomla-projects/soc21_website-cronjob#59
Pinging @ditsuke and @bembelimen since Scheduled Tasks is their baby and they're currently the only ones who can understand this PR.
Summary of Changes
Scheduled tasks can now return
Status::WILL_RESUME
to indicate they are not done and should be rescheduled immediately to resume execution.This is useful for whenever you have long running tasks which would otherwise end up hitting a memory or timeout limit on your server. Some examples of such tasks:
Testing Instructions
The “Task - Demo Tasks!” plugin has been updated with a new sample task called “Resumable task”.
Create a new task using Resumable Task.
Set it to run once every 10 minutes.
Enable Individual Task Logs and set the Log Filename to
resumable.log.php
.Trigger the task scheduler. On each execution, the task has a 60% chance of resuming and 40% chance of finishing.
Actual result BEFORE applying this Pull Request
N/A — Joomla did not support resumable tasks.
Expected result AFTER applying this Pull Request
The
administrator/logs/resumable.log.php
file will contain something like this:As you can see the task can detect whether it's being resumed.
Documentation Changes Required
N/A. There is no documentation on scheduled tasks beyond the demo tasks plugin. The new resumable demo task is self–documenting.
Postscriptum
I have still not managed to find time to integrate scheduled tasks in my own software. I did have, however, the time to study the code and understand better how Scheduled Tasks work. I can already see that they are very appealing. I am looking forward to implementing an integration with them in the next minor versions of my software tentatively scheduled for early Q2 2022. If lazy scheduling works in real world sites as reliably as it does on my test servers it will be a veritable game changer for Joomla!. That's the first time in years I am ecstatic about new code added to Joomla, let alone code added in a minor release. Well done!