コード例 #1
0
ファイル: unshare.php プロジェクト: stweil/owncloud-core
 /**
  * run the job, then remove it from the jobList
  *
  * @param JobList $jobList
  * @param ILogger $logger
  */
 public function execute($jobList, ILogger $logger = null)
 {
     if ($this->shouldRun($this->argument)) {
         parent::execute($jobList, $logger);
         $jobList->remove($this, $this->argument);
         if ($this->retainJob) {
             $this->reAddJob($jobList, $this->argument);
         }
     }
 }
コード例 #2
0
ファイル: TimedJob.php プロジェクト: GitHubUser4234/core
 /**
  * run the job if
  *
  * @param JobList $jobList
  * @param ILogger $logger
  */
 public function execute($jobList, ILogger $logger = null)
 {
     if (time() - $this->lastRun > $this->interval) {
         parent::execute($jobList, $logger);
     }
 }
コード例 #3
0
ファイル: QueuedJob.php プロジェクト: GitHubUser4234/core
 /**
  * run the job, then remove it from the joblist
  *
  * @param JobList $jobList
  * @param ILogger $logger
  */
 public function execute($jobList, ILogger $logger = null)
 {
     $jobList->remove($this, $this->argument);
     parent::execute($jobList, $logger);
 }
コード例 #4
0
 /**
  * call execute() method of parent
  *
  * @param JobList $jobList
  * @param ILogger $logger
  */
 protected function parentExecute($jobList, $logger)
 {
     parent::execute($jobList, $logger);
 }
コード例 #5
0
 /**
  * Run the job if the scheduling conditions are met
  *
  * @param \OCP\BackgroundJob\IJobList $jobList        	
  * @param \OC\Log $logger        	
  */
 public function execute($jobList, $logger = null)
 {
     $firstRunAtHour = $this->getConfigService()->getScheduleTimeUTC();
     if ($this->getLastRun()) {
         $lastRun = new \DateTime();
         $lastRun->setTimestamp($this->getLastRun());
         $shouldExecute = $this->getScheduleService()->isToBeExecutedNow($firstRunAtHour, $lastRun);
     } else {
         $shouldExecute = $this->getScheduleService()->isToBeExecutedNow($firstRunAtHour);
     }
     if ($shouldExecute) {
         parent::execute($jobList, $logger);
     }
 }