diff options
author | 2024-08-08 17:47:04 +0200 | |
---|---|---|
committer | 2024-08-08 17:47:04 +0200 | |
commit | f358f1abec8278c4e5659b311bf8eea5f34802d8 (patch) | |
tree | 67a3472dcf0f76ca3d965f463f934d2519e4e30d /lib | |
parent | 2acd415475e0d1f4b621003a85ece6e47a3790f7 (diff) | |
download | rss-bridge-f358f1abec8278c4e5659b311bf8eea5f34802d8.tar.gz rss-bridge-f358f1abec8278c4e5659b311bf8eea5f34802d8.tar.zst rss-bridge-f358f1abec8278c4e5659b311bf8eea5f34802d8.zip |
refactor: loadCacheValue/saveCacheValue (#4205)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/BridgeAbstract.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php index 2467dec6..6444b6aa 100644 --- a/lib/BridgeAbstract.php +++ b/lib/BridgeAbstract.php @@ -322,16 +322,14 @@ abstract class BridgeAbstract return null; } - protected function loadCacheValue(string $key) + protected function loadCacheValue(string $key, $default = null) { - $cacheKey = $this->getShortName() . '_' . $key; - return $this->cache->get($cacheKey); + return $this->cache->get($this->getShortName() . '_' . $key, $default); } - protected function saveCacheValue(string $key, $value, $ttl = 86400) + protected function saveCacheValue(string $key, $value, int $ttl = null) { - $cacheKey = $this->getShortName() . '_' . $key; - $this->cache->set($cacheKey, $value, $ttl); + $this->cache->set($this->getShortName() . '_' . $key, $value, $ttl); } public function getShortName(): string |