Mark a job as Completed, removing it from the queue.

@param \Queue\Model\Entity\QueuedJob $job Job
@return bool Success
180580
public function markJobDone(QueuedJob $job) {
		$fields = [
			'completed' => $this->getDateTime(),
		];
		$job = $this->patchEntity($job, $fields);

		return (bool)$this->save($job);
	}
740909
public function push(Job $job, $queueName = '')
    {
        if (!isset($this->queues[$queueName])) {
            $this->queues[$queueName] = [];
        }

        $this->queues[$queueName][] = $job;

        return Queue::QUEUED;

    }
855373
private function hasNotStartedChild(Job $job)
    {
        foreach ($job->getChildJobs() as $childJob) {
            if (Job::STATUS_NEW === $childJob->getStatus()) {
                return true;
            }
        }

        return false;
    }
567438
public function deleteAndRelease($queue, $job, $delay)
    {
        $queue = $this->getQueue($queue);

        $reserved = $job->getReservedJob();

        $this->redis->zRem($queue . ':reserved', $reserved);

        $this->redis->zAdd($queue . ':delayed', $this->availableAt($delay), $reserved);
    }
274274
private function pushFailedJob(Job $job)
    {
        $this->failed_jobs[] = $job;
        $command = $job->getCommand();
        // If callable, log the string Closure
        if (is_callable($command)) {
            $command = \is_string($command) ? $command : 'Closure';
        }
        $output = trim($job->getOutput());
        $this->addSchedulerVerboseOutput("<red>Error</red>:   <white>{$command}</white> → <normal>{$output}</normal>");

        return $job;
    }
1375033
public function complete()
    {
        $this->stopped();

        $this->setStatus(Job::STATUS_COMPLETE);

        $this->redis->zadd(Queue::redisKey($this->queue, 'processed'), time(), $this->payload);
        Stats::incr('processed', 1);
        Stats::incr('processed', 1, Queue::redisKey($this->queue, 'stats'));

        Event::fire(Event::JOB_COMPLETE, $this);
    }
1129326
public function delete(Job $job)
    {
        $result = false;
        try {
            $res = $this->_queue->deleteMessage($job->getInstance()->getReceiptHandle());
            $result = $res->isSucceed();
        } catch (\Exception $e) {
            $this->eventsManager->fire('listener:logger', $this, '删除Queue消息失败:' . $e->getMessage());
        } finally {
            return $result;
        }
    }
1192808
public function handleQueuedMessage(Job $job, $data)
    {
        $this->send($data['view'], $data['data'], $this->getQueuedCallable($data));

        $job->delete();
    }
76853
private function pushExecutedJob(Job $job)
    {
        $this->executed_jobs[] = $job;
        $command = $job->getCommand();
        $args = $job->getArguments();
        // If callable, log the string Closure
        if (is_callable($command)) {
            $command = \is_string($command) ? $command : 'Closure';
        }
        $this->addSchedulerVerboseOutput("<green>Success</green>: <white>{$command} {$args}</white>");

        return $job;
    }
1245086
public function workingOn(Job $job)
    {
        $job->worker = $this;
        $this->currentJob = $job;
        $job->updateStatus(Status::STATUS_RUNNING);
        $data = json_encode(array(
            'queue' => $job->queue,
            'run_at' => strftime('%a %b %d %H:%M:%S %Z %Y'),
            'payload' => $job->payload
        ));
        Resque::redis()->set('worker:' . $job->worker, $data);
    }
861171
public function enqueue(Job\WrappedJob $job) {
        $serialized = Job\serializeJobs([$job->withQueueProvider('sync')]);
        $res = unserialize($this->worker->work($serialized));
        if ($res[0]->isFailed()) {
            throw new \RuntimeException("Job Failed - " . json_encode($res[0], JSON_PRETTY_PRINT));
        }
    }
939290
public function processed(JobInterface $job)
    {
        $this->checkConnected();
        $this->client->ackJob($job->getId());
    }
931637
public function delete(Job $job)
    {
        $this->pheanstalk->delete($job);

        $this->logJob($job->getId(), 'Job deleted');
    }
292451
private function setWorkingOn(Job $job)
    {
        $this->setTask(
            [
                'queue' => $job->getQueue(),
                'run_at' => strftime('%a %b %d %H:%M:%S %Z %Y'),
                'payload' => $job->getPayload(),
            ]
        );

        $this->current_job = $job;
        $job->setWorker($this->getId());
        $this->job_manager->updateStatus($job, JobManager::STATUS_RUNNING);
    }
874471
public function isRunning(Job $job) {
        $runner = $this->getJobRunner($job);

        return $runner->isRunning($job);
    }
183481
public function markJobFailed(QueuedJob $job, $failureMessage = null) {
		$fields = [
			'failed' => $job->failed + 1,
			'failure_message' => $failureMessage,
		];
		$job = $this->patchEntity($job, $fields);

		return (bool)$this->save($job);
	}
658547
def job_success(self, job, queue, job_result):
        
        job.queued.delete()
        job.hmset(end=str(datetime.utcnow()), status=STATUSES.SUCCESS)
        queue.success.rpush(job.ident)
        self.log(self.job_success_message(job, queue, job_result))
        if hasattr(job, 'on_success'):
            job.on_success(queue, job_result)