Skip to content

Commit

Permalink
Disable SQL logging
Browse files Browse the repository at this point in the history
  • Loading branch information
CatoTH committed Dec 1, 2024
1 parent c51f6e0 commit 56c6f04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions commands/BackgroundJobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 56c6f04

Please sign in to comment.