mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-24 20:55:11 +02:00
[core] Remove hardcoded maximum duration of 24 hours in loadCacheValue (#3355)
This commit is contained in:
parent
a4a7473abb
commit
343fd36671
4 changed files with 7 additions and 7 deletions
|
@ -409,10 +409,10 @@ abstract class BridgeAbstract implements BridgeInterface
|
|||
* Loads a cached value for the specified key
|
||||
*
|
||||
* @param string $key Key name
|
||||
* @param int $duration Cache duration (optional, default: 24 hours)
|
||||
* @param int $duration Cache duration (optional)
|
||||
* @return mixed Cached value or null if the key doesn't exist or has expired
|
||||
*/
|
||||
protected function loadCacheValue($key, int $duration = 86400)
|
||||
protected function loadCacheValue($key, $duration = null)
|
||||
{
|
||||
$cacheFactory = new CacheFactory();
|
||||
|
||||
|
@ -421,7 +421,7 @@ abstract class BridgeAbstract implements BridgeInterface
|
|||
$scope = $this->getShortName();
|
||||
$cache->setScope($scope);
|
||||
$cache->setKey($key);
|
||||
if ($cache->getTime() < time() - $duration) {
|
||||
if ($duration && $cache->getTime() < time() - $duration) {
|
||||
return null;
|
||||
}
|
||||
return $cache->loadData();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue