diff options
Diffstat (limited to 'apps/files_versions/lib/BackgroundJob/ExpireVersions.php')
-rw-r--r-- | apps/files_versions/lib/BackgroundJob/ExpireVersions.php | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/apps/files_versions/lib/BackgroundJob/ExpireVersions.php b/apps/files_versions/lib/BackgroundJob/ExpireVersions.php index d69e5bb87ce..47a1903a535 100644 --- a/apps/files_versions/lib/BackgroundJob/ExpireVersions.php +++ b/apps/files_versions/lib/BackgroundJob/ExpireVersions.php @@ -44,22 +44,12 @@ class ExpireVersions extends \OC\BackgroundJob\TimedJob { */ private $userManager; - public function __construct(IUserManager $userManager = null, Expiration $expiration = null) { + public function __construct(IUserManager $userManager, Expiration $expiration) { // Run once per 30 minutes $this->setInterval(60 * 30); - if (is_null($expiration) || is_null($userManager)) { - $this->fixDIForJobs(); - } else { - $this->expiration = $expiration; - $this->userManager = $userManager; - } - } - - protected function fixDIForJobs() { - $application = new Application(); - $this->expiration = $application->getContainer()->query('Expiration'); - $this->userManager = \OC::$server->getUserManager(); + $this->expiration = $expiration; + $this->userManager = $userManager; } protected function run($argument) { |