Cron processed only one item when ultimate_cron installed

Created on 13 March 2023, over 1 year ago
Updated 21 June 2024, 5 days ago

Problem/Motivation

hook_cron() does not accept any arguments. Functions implementing hooks should follow the defined API, otherwise they open up the possibility of errors. mailchimp_cron() should not receive any arguments based on the API defined by core.api.php; it does however get an argument In this case in order to allow the Drush command passing the batch limit as an argument.

The Ultimate Cron module - not sure about about the details of their implementation - passes its Job object as the first argument. This conflicts with the argument defined by mailchimp causing errors and only one queue item to processed regardless of the configuration setting.

Steps to reproduce

Install the Ultimate Cron module, and run the mailchimp cron. Observe that only one item is processed every time, regardless of how many are in the queue and regardless of the limit set in configuration.

Proposed resolution

A solution is to provide a service that processes queue items, which can accept arguments as needed. Then call that service from cron or drush.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

General

Created by

πŸ‡΅πŸ‡ͺPeru krystalcode

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024