From 4dd378c1bee279687c0c0731a1d530b18808ec6f Mon Sep 17 00:00:00 2001 From: Matei Stanca Date: Sat, 15 Jul 2023 16:59:57 -0400 Subject: [PATCH] Issue #3: Remove $drush variable; trying just 'drush' in sub commands. --- .do/run-background-tasks.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.do/run-background-tasks.php b/.do/run-background-tasks.php index aa6d12d4..fdd75a3f 100644 --- a/.do/run-background-tasks.php +++ b/.do/run-background-tasks.php @@ -7,8 +7,6 @@ require __DIR__ . '/../vendor/autoload.php'; -$drush = \realpath(__DIR__ . '/../vendor/bin/drush'); - /** @var \React\EventLoop\LoopInterface */ $loop = Loop::get(); @@ -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(); }); });