Skip to content

Commit

Permalink
Issue #3: Merged all warmer processing into one to fix too much at once.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambient-Impact committed Jul 15, 2023
1 parent 578e33b commit ff6e907
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .do/run-background-tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,20 @@
))->start();
});

// Every 10 minutes, process the wiki page changes queue.
$loop->addPeriodicTimer(600, function() use ($drush): void {
(new WorkerProcess($drush . ' omnipedia:changes-build --verbose'))->start();
});
// Every 10 minutes, enqueue and process the warmer queue.
$loop->addPeriodicTimer(600, function() use ($drush, $loop): void {

$loop->futureTick(function() use ($drush): void {
(new WorkerProcess($drush . ' warmer:enqueue ' . \implode(',', [
'omnipedia_wiki_node_changes',
'omnipedia_wiki_node_cdn',
])))->start();
});

$loop->futureTick(function() use ($drush): void {
(new WorkerProcess($drush . ' queue:process warmer'))->start();
});

// Every 10 minutes, process the wiki page CDN warmer queue.
$loop->addPeriodicTimer(600, function() use ($drush): void {
(new WorkerProcess(
$drush . ' warmer:enqueue omnipedia_wiki_node_cdn --run-queue --verbose'
))->start();
});

$loop->run();

0 comments on commit ff6e907

Please sign in to comment.