/** * @param JobList $jobList * @param \OC\Log $logger */ public function execute($jobList, $logger = null) { $jobList->setLastRun($this); try { $this->run($this->argument); } catch (\Exception $e) { if ($logger) { $logger->error('Error while running background job: ' . $e->getMessage()); } $jobList->remove($this, $this->argument); } }
/** * run the job, then remove it from the joblist * * @param JobList $jobList * @param \OC\Log $logger */ public function execute($jobList, $logger = null) { $jobList->remove($this, $this->argument); parent::execute($jobList, $logger); }