That... Could have gone better

This commit is contained in:
Pablo Ferreiro 2022-03-11 23:18:26 +01:00
parent 605e204453
commit c62df9d631
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
11 changed files with 32 additions and 39 deletions

View file

@ -27,7 +27,11 @@ class RedisCache {
return null;
}
public function set(string $cache_key, array $data, $timeout = 3600) {
$this->client->set($cache_key, json_encode($data), $timeout);
public function exists(string $cache_key): bool {
return $this->client->exists($cache_key);
}
public function set(string $cache_key, string $data, $timeout = 3600) {
$this->client->set($cache_key, $data, $timeout);
}
}