From 56c6f0498ea4f43ffe9d8505df6afaeb71f81f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Sun, 1 Dec 2024 13:04:06 +0100 Subject: [PATCH] Disable SQL logging --- commands/BackgroundJobController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); } }