Example #1
0
 /**
  * Log a failed job into storage.
  *
  * @param  string  $connection
  * @param  \Illuminate\Queue\Jobs\Job  $job
  * @return void
  */
 protected function logFailedJob($connection, Job $job)
 {
     if ($this->failer) {
         $this->failer->log($connection, $job->getQueue(), $job->getRawBody());
         $job->delete();
         $this->raiseFailedJobEvent($connection, $job);
     }
 }
Example #2
0
 /**
  * Raise the failed queue job event.
  *
  * @param  string  $connection
  * @param  \Illuminate\Queue\Jobs\Job  $job
  * @return void
  */
 protected function raiseFailedJobEvent($connection, Job $job)
 {
     if ($this->events) {
         $data = json_decode($job->getRawBody(), true);
         $this->events->fire('illuminate.queue.failed', array($connection, $job, $data));
     }
 }
Example #3
0
 /**
  * Get the raw body string for the job.
  *
  * @return string
  */
 public function getRawBody()
 {
     return $this->job->getRawBody();
 }