mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-31 15:30:01 +02:00
refactor: loadCacheValue/saveCacheValue (#4205)
This commit is contained in:
parent
2acd415475
commit
f358f1abec
8 changed files with 188 additions and 158 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue