1
0
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:
Dag
2024-08-08 17:47:04 +02:00
committed by GitHub
parent 2acd415475
commit f358f1abec
8 changed files with 188 additions and 158 deletions

View File

@@ -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