[core] Remove hardcoded maximum duration of 24 hours in loadCacheValue (#3355)

This commit is contained in:
Eugene Molotov 2023-04-19 20:53:35 +05:00 committed by GitHub
parent a4a7473abb
commit 343fd36671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -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();