Needs work
Project:
Drupal core
Version:
main
Component:
cron system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Jul 2019 at 16:54 UTC
Updated:
19 Jul 2025 at 14:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
deviantintegral commentedHere's a first pass. I'd like feedback before writing test coverage for the new class.
Comment #3
deviantintegral commentedComment #4
deviantintegral commentedComment #6
deviantintegral commentedFixes wrong brackets when claiming items.
Comment #7
neclimdul(time() < time() + $process_time)
That doesn't look right...
Comment #8
andypostit needs trick to provide BC and deprecate argument
Deprecation should be according to https://www.drupal.org/core/deprecation#how-param
no reason for 2 syscalls, there's time service
should be logger
Comment #10
deviantintegral commentedI originally had this since we need time updated on every iteration and thought it was easier to read. I've changed it to a local variable.
It's a service, so according to the BC docs we don't need to preserve compatibility?
Done! There's a placeholder for the change record node ID.
Yes, but then we'd have to inline the contents of watchdog_exception into a private function. Since #2932518: Deprecate watchdog_exception is still needs work it seems ok to use the procedural function while it's not deprecated?
Comment #11
johnwebdev commentedSo not sure if we do scalar type hinting, yet?
These comments should be removed.
Should the type really be "cron" here?
I'm wondering if we should remove this method, and keep the existing method in Cron, and simply update it to use this service. That would mean this service is decoupled from any runner.
Comment #15
larowlanComing here from #3228000: Users deleted via JSON:API DELETE don't follow the site-wide cancel_method in the user settings where we really need queue processing for JSON:API
we'll need to remove the typehint here for BC reasons, and check the type of the passed object.
If it's a queue factory, we'll need to trigger a deprecation error and fetch the queue processor from the \Drupal singleton
I know you've mentioned above that this isn't consistent with our docs, but when the effort is minimal, we provide BC for service constructors to make the minor release process less arduous.
these need updating now
We normally use protected in core to allow for an extension point
missing a comment
let's typehint this with a void return
Yes, I agree that's a good idea
Comment #16
catchComment #17
wim leersComment #18
bradjones1Grammar fix in title.
Comment #22
mile23I suggest this should be more formally part of the Queue API (rather than cron), under
Drupal\Core\Queuenamespace and the service namedqueue.processor.Also +1 on #11.4.
(Closed #3008997: Split \Drupal\Core\Cron::processQueues into its own class as a duplicate of this issue.)
Comment #24
moshe weitzman commentedWould still be helpful