Skip to content

Commit

Permalink
Preconfigure Purge to use alternate database storage on install
Browse files Browse the repository at this point in the history
We cannot wait for config import to do this as installing the module
will try to use the purge queue before config import is run.

Consequently we have to set the value manually in an update hook.

10032 has already been applied on staging with release 2025.3.1 so we
need to add a new update hook for this.
  • Loading branch information
kasperg committed Jan 15, 2025
1 parent bb679e1 commit eb20e4f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web/modules/custom/dpl_update/dpl_update.install
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,12 @@ function dpl_update_update_10031(): string {
function dpl_update_update_10032(): string {
return _dpl_update_install_modules(['purge_queues']);
}

/**
* Use alternate database backend for purge queue.
*/
function dpl_update_update_10033(): string {
// @see https://git.drupalcode.org/project/purge_queues/-/blob/2.0.x/src/Plugin/Purge/Queue/AltDatabaseQueue.php?ref_type=heads#L12
\Drupal::configFactory()->getEditable('purge.plugins')->set('queue', 'database_alt')->save();
return 'Configured purge queue to use database_alt.';
}

0 comments on commit eb20e4f

Please sign in to comment.