Esempio n. 1
0
 private function workOn(CommittedJob $job, HandlerInterface $jobHandler)
 {
     try {
         $this->logger->notice("Starting work on {$job->getId()}");
         $logProvider = new LogProvider($this->logger, $jobHandler);
         $this->jobExecutor->execute($job, $logProvider);
         $this->metro->succeed($job->getId());
         $this->logger->notice("Finished work on {$job->getId()}");
     } catch (\Exception $e) {
         $this->logException($e, $job->getId());
         $this->metro->fail($job->getId());
     }
 }
Esempio n. 2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $jobId = $input->getArgument('job-id');
     $this->metro->retry($jobId);
 }
Esempio n. 3
0
 function it_can_retry_jobs(ConsumableQueue $metro)
 {
     $metro->retry('123')->shouldBeCalled();
     $output = $this->execute(['job-id' => '123']);
     expect($output->fetch())->toEqual('');
 }