コード例 #1
0
 /**
  * Process job configuration delete.
  *
  * @param JobConfigurationInterface $configuration
  * @param Request $request
  *
  * @return bool
  *
  * @throws JobConfigurationException
  */
 public function process(JobConfigurationInterface $configuration, Request $request)
 {
     if (!function_exists('posix_getsid')) {
         throw new JobConfigurationException('Function posix_getsid don\'t exists');
     }
     if ($request->isMethod('POST')) {
         return $this->restoreManager->reset($configuration);
     }
     return false;
 }
コード例 #2
0
ファイル: JobQueue.php プロジェクト: dpk125/JobQueue
 /**
  * Reset job.
  *
  * @param string $queue
  *
  * @throws JobConfigurationException
  */
 public function reset($queue)
 {
     if (!function_exists('posix_getsid')) {
         throw new JobConfigurationException('Function posix_getsid don\'t exists');
     }
     $configurations = $this->configurationManager->findPotentialDeadJobs($this->getNextStartWithTimeout(), $queue);
     foreach ($configurations as $configuration) {
         if ($this->restoreManager->reset($configuration)) {
             $this->configurationManager->save();
             break;
         }
     }
 }