Skip to content

Releases: deliciousbrains/wp-background-processing

1.4.0

17 Dec 14:15
7ca7cc3
Compare
Choose a tag to compare

What's Changed

  • Updated CODEOWNERS to use jira key by @bhardie in #117
  • Add Chain ID for better control of background process lifecycle by @ianmjones in #124

Full Changelog: 1.3.1...1.4.0


Chain ID

A Chain ID has been introduced that is automatically generated for each unique chain of background processes.

The Chain ID is a UUIDv4.

The Chain ID is carried across from one dispatched background process to its successor via a simple URL param in order to be as compatible as possible.

To avoid any potential WAF rules that might take offence to a chain_id param in the URL, the default chain_id param name can be altered via a {identifier}_chain_id_arg_name filter.

The Chain ID is exposed to interested parties in a number of ways to allow users of the library to monitor and control the lifecycle of background processes, e.g. to ensure that only one process chain is running.

There is now a {identifier}_pre_dispatch filter that is fired before dispatch which can be used to cancel a dispatch before it happens by returning true (for cancel). The 2nd param to the new filter is the chain_id.

The existing {identifier}_paused/resumed/cancelled/completed actions now include the chain_id as a param.

Similarly, the {identifier}_process_locked and {identifier}_process_unlocked actions now include the chain_id as a param.

Port-forwarded Improvements

Various other improvements have been port-forwarded from use in our plugins.

  • A new get_status function that works around issues with the options cache exists and is used by is_paused and is_cancelled.
  • The lock_process function now takes an optional $reset_start_time param that is true by default. This is useful when you wish to refresh the lock transient to keep it alive longer without changing the start time held in the record that may be significant to a calculation.
  • A public should_continue function has been added that wraps the checks of batch limits or status change requests that mean no further processing of the task should continue.
  • A public get_identifier function has been added to make it easier to create hooks in plugins that use the library and validate that the process is of interest.

1.3.1

28 Feb 13:43
6d1e481
Compare
Choose a tag to compare

What's Changed

  • Added CODEOWNERS file by @bhardie in #114
  • Ensure 1st healthcheck runs in the future, not immediately before dispatch by @ianmjones in #116

New Contributors

Full Changelog: 1.3.0...1.3.1

1.3.0

08 Feb 14:36
33b7bc1
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.1.1...1.3.0

1.1.1

18 Jul 10:33
ebbed76
Compare
Choose a tag to compare

What's Changed

  • Ensure task processing cleanly pauses or cancels as soon as possible by @ianmjones in #101

Full Changelog: 1.1.0...1.1.1

1.1.0

18 Apr 12:41
d5ef95c
Compare
Choose a tag to compare

This release ports forward improvements made to WP Offload Media (WP Background Processing was originally extracted from it).

Improvements include:

  • Incomplete batch records are updated more often for better visibility.
  • It is now possible to throttle the processing to give the server a breather after each batch is processed.
  • It is now possible to pause, resume and cancel a background process.
  • It is now possible to check whether a background process has queued items, is running, is pausing or being cancelled, otherwise known as active.
  • A background process now fires actions when it has been paused, resumed, cancelled or completed.
  • It is now possible to fully clear all saved queue items.
  • Adding multiple batches in the same PHP process no longer results in batches prepended with the data of previously added batches.
  • Various minor improvements and updated README.

1.0.2

31 Jul 07:05
Compare
Choose a tag to compare
Tagging v1.0.2

1.0.1

12 Feb 09:28
Compare
Choose a tag to compare
Update license in composer.json