Ejemplo n.º 1
0
 /**
  *
  * @return boolean
  */
 public function isBackupExecuting()
 {
     $running = $this->configService->getAppValue('BACKUP_RUNNING', 'false');
     if ($running == 'false') {
         return false;
     }
     $filename = $this->configService->getLogfileName();
     if (file_exists($filename)) {
         $ts = filemtime($filename);
     } else {
         return false;
     }
     $lastLogfileEntry = new \DateTime('@' . $ts);
     if ($lastLogfileEntry->add(new \DateInterval(self::MAX_TIME_INTERVAL)) < new \DateTime()) {
         // More than MAX_TIME_INTERVAL since the last logfile entry => we suppose the job is hung
         $this->configService->setAppValue('BACKUP_RUNNING', 'false');
         return false;
     }
     return true;
 }