Skip to content

Commit bedd300

Browse files
committed
Fixed date issue in tags item where tags item always last as long as default ttl configuration
1 parent 8a85a14 commit bedd300

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/Phpfastcache/Core/Pool/TaggableCacheItemPoolTrait.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -361,17 +361,9 @@ protected function driverWriteTags(ExtendedCacheItemInterface $item): bool
361361
* that has slow performances
362362
*/
363363

364-
$tagsItem->set(\array_merge((array)$data, [$item->getKey() => $expTimestamp]));
364+
$tagsItem->set(\array_merge((array)$data, [$item->getKey() => $expTimestamp]))
365+
->expiresAt($item->getExpirationDate());
365366

366-
/**
367-
* Set the expiration date
368-
* of the $tagsItem based
369-
* on the older $item
370-
* expiration date
371-
*/
372-
if ($expTimestamp > $tagsItem->getExpirationDate()->getTimestamp()) {
373-
$tagsItem->expiresAt($item->getExpirationDate());
374-
}
375367
$this->driverWrite($tagsItem);
376368
$tagsItem->setHit(true);
377369
}

0 commit comments

Comments
 (0)