]> git.mxchange.org Git - friendica.git/blobdiff - bin/daemon.php
Show month/halfyear usage
[friendica.git] / bin / daemon.php
index fcdd735668cf042550a3f598c6311419a7c70431..c7a16a9e8d5b0952f732160ec1e63ad977ba291a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env php
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -60,6 +60,7 @@ $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config
 $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['daemon']]);
 
 DI::init($dice);
+\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
 $a = DI::app();
 
 if (DI::mode()->isInstall()) {
@@ -195,7 +196,7 @@ while (true) {
                $do_cron = true;
        }
 
-       if ($do_cron || (!DI::process()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
+       if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
                Worker::spawnWorker($do_cron);
        } else {
                Logger::info('Cool down for 5 seconds', ['pid' => $pid]);