X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fdaemon.php;h=1682d366ede0ca16fd05c3ab8f0df7bd04b13a0a;hb=51a7b5c5846c320dd273f5b1005d856416dd1252;hp=965c495ecdbc5af9cf0961cb15319ea93c28fa85;hpb=4236a9a1059411c1d6483f772af30322ce713f0e;p=friendica.git diff --git a/bin/daemon.php b/bin/daemon.php index 965c495ecd..1682d366ed 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -1,7 +1,7 @@ #!/usr/bin/env php . * + */ + +/** * Run the worker from a daemon. * * This script was taken from http://php.net/manual/en/function.pcntl-fork.php */ - -use Friendica\Network\HTTPException\ForbiddenException; - if (php_sapi_name() !== 'cli') { - throw new ForbiddenException(); + header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden'); + exit(); } use Dice\Dice; @@ -197,7 +198,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]); @@ -231,7 +232,7 @@ while (true) { } $timeout = ($seconds >= $wait_interval); - } while (!$timeout && !Worker::IPCJobsExists()); + } while (!$timeout && !Worker\IPC::JobsExists()); if ($timeout) { $do_cron = true;