Job retries

This commit is contained in:
Juan Pablo Vial
2025-06-27 18:42:47 -04:00
parent 1bbee1121b
commit 7f8bd607e3
4 changed files with 99 additions and 13 deletions

View File

@ -12,14 +12,18 @@ class Redis
/**
* @param string $name
* @return string|null
* @throws Exception|ConnectionException
* @throws Exception
*/
public function get(string $name): ?string
{
if (!$this->client->exists($name)) {
throw new Exception($name);
}
return $this->client->get($name);
try {
return $this->client->get($name);
} catch (ConnectionException $exception) {
throw new Exception($exception->getMessage(), $exception->getCode(), $exception);
}
}
/**
@ -27,7 +31,6 @@ class Redis
* @param mixed $value
* @param int $expirationTTL
* @return void
* @throws ConnectionException
*/
public function set(string $name, mixed $value, int $expirationTTL = 60 * 60 * 24): void
{