mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-10 18:44:04 +02:00
refactor: loadCacheValue/saveCacheValue (#4205)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user