/** * 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; }
/** * 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; } } }