From 11540a8bffcbb9dcdb592a460ba4bcf9222b3d9f Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 10:49:34 +0000 Subject: [PATCH] Replace DI::system() with container --- src/App.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.php b/src/App.php index 821e7b7104..d4f3a35837 100644 --- a/src/App.php +++ b/src/App.php @@ -378,6 +378,9 @@ class App $basePath = $this->container->create(BasePath::class); $path = $basePath->getPath(); + /** @var System */ + $system = $this->container->create(System::class); + // Now running as a daemon. while (true) { // Check the database structure and possibly fixes it @@ -388,7 +391,7 @@ class App $do_cron = true; } - if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) { + if ($do_cron || (!$system->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) { Worker::spawnWorker($do_cron); } else { Logger::info('Cool down for 5 seconds', ['pid' => $pid]);