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

Comments

abhishek-anand created an issue. See original summary.

abhishek-anand’s picture

abhishek-anand’s picture

Status: Needs work » Needs review
StatusFileSize
new2.43 KB
berdir’s picture

Status: Needs review » Needs work

It'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.

berdir’s picture

Assigned: abhishek-anand » berdir

Working a bit on this, based on notes in #2708789: General settings should be plugins.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new26.02 KB

Ok, 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.

Status: Needs review » Needs work

The last submitted patch, 6: cron_queue_processing-2704543-6.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new26.66 KB
new658 bytes

Status: Needs review » Needs work

The last submitted patch, 8: cron_queue_processing-2704543-8.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new32.71 KB
new9.65 KB

Fixed 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.

Status: Needs review » Needs work

The last submitted patch, 10: cron_queue_processing-2704543-10.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new33.48 KB
new792 bytes

Oops.

Status: Needs review » Needs work

The last submitted patch, 12: cron_queue_processing-2704543-12.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new4.56 KB
new1.08 KB

Work in progress.

current plan is to expose this with minimal settings and then figure out per-job and more advanced settings later.

Status: Needs review » Needs work

The last submitted patch, 14: do_not_allow_setting-1266748-54.patch, failed testing.

berdir’s picture

That was the wrong patch...

berdir’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new24.63 KB

This is the patch I wanted to upload. Working on tests and the UI now.

berdir’s picture

Ok, 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.

  • Berdir committed 3dbd863 on 8.x-2.x
    Issue #2704543 by Berdir, abhishek-anand: Implement cron queue...
berdir’s picture

Status: Needs review » Fixed

Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.