Skip to content

Commit

Permalink
Issue #3: Remove $drush variable; trying just 'drush' in sub commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambient-Impact committed Jul 15, 2023
1 parent 5fd7b77 commit 4dd378c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .do/run-background-tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

require __DIR__ . '/../vendor/autoload.php';

$drush = \realpath(__DIR__ . '/../vendor/bin/drush');

/** @var \React\EventLoop\LoopInterface */
$loop = Loop::get();

Expand All @@ -18,29 +16,29 @@
});

// Run cron every 15 minutes.
$loop->addPeriodicTimer(900, function() use ($drush): void {
(new WorkerProcess($drush . ' cron'))->start();
$loop->addPeriodicTimer(900, function(): void {
(new WorkerProcess('drush cron'))->start();
});

// Every 5 minutes, process jobs from the image style warmer.
$loop->addPeriodicTimer(300, function() use ($drush): void {
$loop->addPeriodicTimer(300, function(): void {
(new WorkerProcess(
$drush . ' queue:process image_style_warmer_pregenerator'
'drush queue:process image_style_warmer_pregenerator'
))->start();
});

// Every 10 minutes, enqueue and process the warmer queue.
$loop->addPeriodicTimer(600, function() use ($drush, $loop): void {
$loop->addPeriodicTimer(600, function() use ($loop): void {

$loop->futureTick(function() use ($drush): void {
(new WorkerProcess($drush . ' warmer:enqueue ' . \implode(',', [
$loop->futureTick(function(): 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();
$loop->futureTick(function(): void {
(new WorkerProcess('drush queue:process warmer'))->start();
});

});
Expand Down

0 comments on commit 4dd378c

Please sign in to comment.