Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment #N
Problem/Motivation
RequestCloseSubscriber::onTerminate
calls the global system_run_automated_cron
function. This may backfire on lean requests, i.e whenever drupal is not bootstrapped fully.
Proposed resolution
Turn system_run_automated_cron
into its own proper subscriber for the KernelEvents::TERMINATE
event.
Remaining tasks
Review
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#5 | 2220687-convert-system_run_automated_cron-3.patch | 4.8 KB | znerol |
Comments
Comment #1
znerol CreditAttribution: znerol commentedComment #3
dawehnerFirst note: Is there a reason this is not part of core but part of system module? ... It would be also nice if it would be part of a "EventSubscriber" namespace, just for consistency.
let's add another pair of braces around REQUEST_TIME - $cron_list, to be sure it works as we want.
Comment #4
znerol CreditAttribution: znerol commentedThanks for the review.
I feel that it should be part of the module because it accesses configuration defined by the module (
system.cron
/threshold.autorun
).Yes indeed. I saw
Drupal\system\SystemConfigSubscriber
and was mislead into doing it like that one. That is probably not the best example.Let's just replace those convoluted conditions with something which is more readable.
Comment #5
znerol CreditAttribution: znerol commentedComment #6
dawehnerAwesome!
Comment #7
catchI still think we should do #1599622: Run poormanscron via a non-blocking HTTP request but this is good clean-up independent of that issue.
Committed/pushed to 8.x, thanks!