/** * 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); } }
/** * 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)); } }
/** * Get the raw body string for the job. * * @return string */ public function getRawBody() { return $this->job->getRawBody(); }