Exemplo n.º 1
0
 /**
  * Log a failed job into storage.
  *
  * @param string                       $connection
  * @param \Viserio\Contracts\Queue\Job $job
  *
  * @return void|null
  */
 protected function logFailedJob(string $connection, JobContract $job)
 {
     if ($this->failed === null) {
         return;
     }
     $failedId = $this->failed->log($connection, $job->getQueue(), $job->getRawBody());
     $job->delete();
     $job->failed();
     if ($this->events !== null) {
         $this->events->trigger('viserio.job.failed', ['connection' => $connection, 'job' => $job, 'data' => json_decode($job->getRawBody(), true), 'failedId' => $failedId]);
     }
 }