setInterval(15 * 60); $this->log = $log; $this->config =\OC::$server->getConfig(); $this->installer = \OC::$server->query(Installer::class); } protected function run($argument) { $ocApp = new \OC_App(); $apps = $ocApp->listAllApps(); foreach($apps as $app) { if(!$app["active"]) continue; $appId = $app["id"]; try { if ($this->installer->isUpdateAvailable($appId)) { $this->config->setSystemValue('maintenance', true); $this->installer->updateAppstoreApp($appId); $this->config->setSystemValue('maintenance', false); } } catch (\Exception $ex) { $this->log->logException($ex, ['app' => 'appsautoupdate']); $this->config->setSystemValue('maintenance', false); } } } }