Minor correction

This commit is contained in:
Netkas 2023-06-16 01:47:59 -04:00
parent db47d0fc0e
commit f0ceb736d1
No known key found for this signature in database
GPG key ID: 5DAF58535614062B

View file

@ -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)
{