diff --git a/commands/BackgroundJobController.php b/commands/BackgroundJobController.php index 003b72028..3daf65c22 100644 --- a/commands/BackgroundJobController.php +++ b/commands/BackgroundJobController.php @@ -23,7 +23,10 @@ class BackgroundJobController extends Controller */ public function actionRun(): void { - $processor = new BackgroundJobProcessor(\Yii::$app->getDb()); + $connection = \Yii::$app->getDb(); + $connection->enableLogging = false; + + $processor = new BackgroundJobProcessor($connection); while (!$this->needsRestart($processor)) { $row = $processor->getJobAndSetStarted(); if ($row) { @@ -32,7 +35,7 @@ public function actionRun(): void usleep(100000); } - file_put_contents('/tmp/memory_usage.log', memory_get_peak_usage() . "\n", FILE_APPEND); + file_put_contents('/tmp/memory_usage.log', date("Y-m-d H:i:s") . ": " . memory_get_peak_usage() . "\n", FILE_APPEND); } }