X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fworker.php;h=084ad28979b667dacbfa8bd4600c764e27a8148f;hb=259b99e6e94cd6714e65bb128af9cbe776fd3325;hp=52400a045a4e4b9d57051edbed9c6289ece7e412;hpb=9a6141dcbeb8c0334356d7e92060748906fd6e46;p=friendica.git diff --git a/bin/worker.php b/bin/worker.php index 52400a045a..084ad28979 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -1,7 +1,7 @@ #!/usr/bin/env php addRules(include __DIR__ . '/../static/dependencies.config $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['worker']]); DI::init($dice); +\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); $a = DI::app(); DI::mode()->setExecutor(Mode::WORKER); @@ -80,8 +81,10 @@ if ($spawn) { $run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options); -Worker::processQueue($run_cron); +$process = DI::process()->create(getmypid(), basename(__FILE__)); -Worker::unclaimProcess(); +Worker::processQueue($run_cron, $process); -DI::process()->end(); +Worker::unclaimProcess($process); + +DI::process()->delete($process);