From 0ce3da28d73d5102a2e6449e693dbe0be4690ac2 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 28 Aug 2020 17:04:21 +0200 Subject: [PATCH] query instead of create Application in background jobs --- lib/Cron/Cache.php | 2 +- lib/Cron/Chunk.php | 2 +- lib/Cron/Queue.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cron/Cache.php b/lib/Cron/Cache.php index 2552766f..afd05be6 100644 --- a/lib/Cron/Cache.php +++ b/lib/Cron/Cache.php @@ -76,7 +76,7 @@ class Cache extends TimedJob { * @throws QueryException */ protected function run($argument) { - $app = new Application(); + $app = \OC::$server->query(Application::class); $c = $app->getContainer(); $this->accountService = $c->query(AccountService::class); diff --git a/lib/Cron/Chunk.php b/lib/Cron/Chunk.php index 718737d4..7cfaba9d 100644 --- a/lib/Cron/Chunk.php +++ b/lib/Cron/Chunk.php @@ -66,7 +66,7 @@ class Chunk extends TimedJob { * @throws QueryException */ protected function run($argument) { - $app = new Application(); + $app = \OC::$server->query(Application::class); $c = $app->getContainer(); $this->configService = $c->query(ConfigService::class); diff --git a/lib/Cron/Queue.php b/lib/Cron/Queue.php index ce724b92..b915a78d 100644 --- a/lib/Cron/Queue.php +++ b/lib/Cron/Queue.php @@ -76,7 +76,7 @@ class Queue extends TimedJob { * @throws QueryException */ protected function run($argument) { - $app = new Application(); + $app = \OC::$server->query(Application::class); $c = $app->getContainer(); $this->requestQueueService = $c->query(RequestQueueService::class);