/** * Marks a job as failed and deletes it from the beanstalk tube * * @param WorkPackage $task * @param string $log * @throws TaskQueueServiceException * @return void */ public function markFailed(WorkPackage $task, $log) { if ($this->logWorkerOutputOnFailure) { $this->updateTaskLog($task, $log); } $this->updateTaskStatus($task, Task::STATUS_FAILED); $this->beanstalk->delete($task->getPheanstalkJob()); }
/** * @return void */ public function testIfDeleteWrapsProperly() { $job = Mockery::mock('\\Pheanstalk_Job'); $this->pheanstalk->shouldReceive('delete')->with($job)->once(); $this->connection->delete($job); }