Problem/Motivation
Ultimate currently just calls core's queue processing.
Proposed resolution
* Expose queue worker plugins as cron jobs. That allows to control how often they are called, instead of every single cron call.
* Have them call a worker that does . It's a mix of on the 7.x ultimate_cron and 8.x core implementation but doesn't currently support all the features.
* Hidden global features are hidden until tested/implemented.
* Per cron job settings beside scheduling is not yet supported, #2708789: General settings should be plugins will be about that.
Remaining tasks
* Hide the settings
* Some basic tests
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | cron_queue_processing-2704543-18-interdiff.txt | 7.33 KB | berdir |
| #18 | cron_queue_processing-2704543-18.patch | 28.79 KB | berdir |
| #17 | cron_queue_processing-2704543-14.patch | 24.63 KB | berdir |
| #14 | do_not_allow_setting-1266748-54-interdiff.txt | 1.08 KB | berdir |
| #14 | do_not_allow_setting-1266748-54.patch | 4.56 KB | berdir |
Comments
Comment #2
abhishek-anand commentedComment #3
abhishek-anand commentedComment #4
berdirIt's not really clear to me what this is doing. This seems to re-execute all cron jobs also as a queue?
Note that queue processing is happening in \Drupal\ultimate_cron\UltimateCron::run, which calls $this->processQueues();. It's not as flexible as it used to be, but we at least are calling and processing the queues in the same ways as cron does.
I think we first need to figure out what we actually need on top of that and then do it in UltimateCron, not our own cron hook.
Comment #5
berdirWorking a bit on this, based on notes in #2708789: General settings should be plugins.
Comment #6
berdirOk, this patch does:
* re-implement logic to create cron jobs for queue tasks.
* add a worker callback to execute one. Still want to support service callbacks but that's probably a follow-up.
* Implement weight and draggable list builder so we can move queue plugins at the end.
* removes the queue settings class.
@todo:
* Implement settings, need to figure out what that actually implies exactly.
Comment #8
berdirComment #10
berdirFixed some tests and started implementing the settings.
I see now how those queue settings are meant to work so that you can override them per cron job. Considering to avoid that complexity for now and think later how to re-introduce that, if there is actually a need for it.
Comment #12
berdirOops.
Comment #14
berdirWork in progress.
current plan is to expose this with minimal settings and then figure out per-job and more advanced settings later.
Comment #16
berdirThat was the wrong patch...
Comment #17
berdirThis is the patch I wanted to upload. Working on tests and the UI now.
Comment #18
berdirOk, made sure that the supported values can be floats, added some tests for general processing and specifically item_delay and actually found a bug while doing so.
This seems to be working pretty well, will commit when green.
Comment #20
berdirCommitted!