]> git.mxchange.org Git - friendica.git/commitdiff
Replace DI::system() with container
authorArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 10:49:34 +0000 (10:49 +0000)
committerArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 10:49:34 +0000 (10:49 +0000)
src/App.php

index 821e7b7104260d732901857d47a3b9bb8a8b8b84..d4f3a35837f92f19b1c6ba0edf38c6d366f679e0 100644 (file)
@@ -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]);