Minor correction
This commit is contained in:
parent
db47d0fc0e
commit
f0ceb736d1
1 changed files with 13 additions and 12 deletions
|
@ -605,7 +605,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Log::debug(Utilities::getName(), sprintf('Returning job %s (Return Channel: %s)', $job_id, $return_channel ?? 'n/a'));
|
||||
Log::debug(Utilities::getName(), sprintf('Returning job %s (Return Channel: %s)', $job_id, $return_channel));
|
||||
$this->getClient()->hSet($job_id, 'return_value', serialize($return_value));
|
||||
$this->getClient()->hSet($job_id, 'status', JobStatus::FINISHED);
|
||||
$this->getClient()->rPush($this->getClient()->hGet($job_id, 'return_channel'), $job_id);
|
||||
|
@ -643,21 +643,22 @@
|
|||
|
||||
try
|
||||
{
|
||||
if($this->getClient()->exists($job_id))
|
||||
if(!$this->getClient()->exists($job_id))
|
||||
{
|
||||
if($this->getClient()->hGet($job_id, 'return_channel') === null)
|
||||
{
|
||||
$this->getClient()->del($job_id);
|
||||
return;
|
||||
}
|
||||
throw new JobNotFoundException(sprintf('Job %s does not exist on %s:%s', $job_id, $this->server_configuration->getHost(), $this->server_configuration->getPort()));
|
||||
}
|
||||
|
||||
Log::debug(Utilities::getName(), sprintf('Returning exception for job %s', $job_id));
|
||||
$this->getClient()->hSet($job_id, 'exception', serialize($throwable));
|
||||
$this->getClient()->hSet($job_id, 'status', JobStatus::FAILED);
|
||||
$this->getClient()->rPush($this->getClient()->hGet($job_id, 'return_channel'), $job_id);
|
||||
Log::debug(Utilities::getName(), sprintf('Pushed job %s to return channel %s', $job_id, $this->getClient()->hGet($job_id, 'return_channel')));
|
||||
if($this->getClient()->hGet($job_id, 'return_channel') === null)
|
||||
{
|
||||
$this->getClient()->del($job_id);
|
||||
return;
|
||||
}
|
||||
|
||||
Log::debug(Utilities::getName(), sprintf('Returning exception for job %s', $job_id));
|
||||
$this->getClient()->hSet($job_id, 'exception', serialize($throwable));
|
||||
$this->getClient()->hSet($job_id, 'status', JobStatus::FAILED);
|
||||
$this->getClient()->rPush($this->getClient()->hGet($job_id, 'return_channel'), $job_id);
|
||||
Log::debug(Utilities::getName(), sprintf('Pushed job %s to return channel %s', $job_id, $this->getClient()->hGet($job_id, 'return_channel')));
|
||||
}
|
||||
catch(RedisException $e)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue