From 4348b0b8737b4da7cfc87ebe73b50a1eb84a43b2 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 09:30:44 +0000 Subject: [PATCH] Move daemon code into anonymous function --- bin/daemon.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/daemon.php b/bin/daemon.php index caa32f123d..40297b3589 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -37,6 +37,7 @@ require dirname(__DIR__) . '/vendor/autoload.php'; $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies.config.php')); +(function (Dice $dice, array $options): void { /** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ $addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); @@ -230,6 +231,7 @@ while (true) { Logger::info('Worker jobs are calling to be forked.', ['pid' => $pid]); } } +})($dice, $options); function shutdown() { posix_kill(posix_getpid(), SIGTERM);