aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2024-08-08 17:47:04 +0200
committerGravatar GitHub <noreply@github.com> 2024-08-08 17:47:04 +0200
commitf358f1abec8278c4e5659b311bf8eea5f34802d8 (patch)
tree67a3472dcf0f76ca3d965f463f934d2519e4e30d /lib
parent2acd415475e0d1f4b621003a85ece6e47a3790f7 (diff)
downloadrss-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.php10
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