fix(CacheInterface): logic bug in getTime (#3491)

* fix(CacheInterface): logic bug in getTime

* test
This commit is contained in:
Dag 2023-07-05 17:37:21 +02:00 committed by GitHub
parent 18e1597361
commit a9fd3b9e61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 24 additions and 22 deletions

View file

@ -423,7 +423,13 @@ abstract class BridgeAbstract implements BridgeInterface
$scope = $this->getShortName();
$cache->setScope($scope);
$cache->setKey($key);
if ($duration && $cache->getTime() < time() - $duration) {
$timestamp = $cache->getTime();
if (
$duration
&& $timestamp
&& $timestamp < time() - $duration
) {
return null;
}
return $cache->loadData();