From 04e92766fc1ab10df6ecdc5b172f27418b57866e Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 26 Dec 2024 19:29:23 +0000 Subject: [PATCH] Refactor calling process repository --- src/App.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/App.php b/src/App.php index f37e38e677..99a788b8ca 100644 --- a/src/App.php +++ b/src/App.php @@ -20,6 +20,7 @@ use Friendica\Core\Config\Factory\Config; use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; use Friendica\Core\Renderer; use Friendica\Core\Session\Capability\IHandleUserSessions; +use Friendica\Core\Worker\Repository\Process as ProcessRepository; use Friendica\Database\DBA; use Friendica\Database\Definition\DbaDefinition; use Friendica\Database\Definition\ViewDefinition; @@ -469,13 +470,16 @@ class App $run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options); - $process = DI::process()->create(getmypid(), basename(__FILE__)); + /** @var ProcessRepository */ + $processRepository = $this->container->create(ProcessRepository::class); + + $process = $processRepository->create(getmypid(), 'worker.php'); Worker::processQueue($run_cron, $process); Worker::unclaimProcess($process); - DI::process()->delete($process); + $processRepository->delete($process); } private function setupContainerForAddons(): void