Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(dev/core#1304) Queues - Define 'status' and 'error' columns #23667

Merged
merged 4 commits into from
Jun 2, 2022

Conversation

totten
Copy link
Member

@totten totten commented Jun 2, 2022

Overview

This is a follow-up to 5.47's introduction of civicrm_queue (persistent queue registrations). It allows extra options to specify the status and error mode.

Contributes to https://lab.civicrm.org/dev/core/-/issues/1304. Extracted from #22762. ping @eileenmcnaughton

Technical Details

  • It adds two new MySQL columns for civicrm_queue:
    • status: Differentiate between active queues (where tasks should run automatically) and various inactive queues (draft, complete, aborted)
    • error: Determine whether errors are fatal (error=>abort) or non-fatal (error=>delete). The fatal approach is more appropriate if you have a short-term queue with a limited scope of inter-dependent tasks. The non-fatal mode is more appropriate if you have a long-term queue that services many independent tasks.
  • The new fields will be important for persistent/registered queues that run tasks automatically in the background. Therefore, Civi::queue() will accept and validate status and error. (However, these fields do not matter if you have older style code.)
  • The upgrader will backfill values of status and error. (There are some code-comments discussing details further.)

totten added 4 commits June 1, 2022 21:03
Note: We only enforce this requirement for queues that use the `runner`
option.  Older queue-users may not specify a `runner` -- in which case
they're responsible for establishing their own runner, and their runner
problem doesn't care what is specified here.
@civibot
Copy link

civibot bot commented Jun 2, 2022

(Standard links)

@civibot civibot bot added the master label Jun 2, 2022
@eileenmcnaughton eileenmcnaughton merged commit f6e1027 into civicrm:master Jun 2, 2022
@totten totten deleted the master-queue-status-error branch June 2, 2022 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants