jobList = $jobList; $this->userManager = $userManager; $this->config = $config; } /** * @return string */ public function getName() { return 'Add preview cleanup background jobs'; } public function run(IOutput $output) { if (!$this->config->getAppValue('core', 'previewsCleanedUp', false)) { $this->userManager->callForSeenUsers(function (IUser $user) { $this->jobList->add(CleanPreviewsBackgroundJob::class, ['uid' => $user->getUID()]); }); $this->config->setAppValue('core', 'previewsCleanedUp', '1'); } } }