Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 84b48de

Browse files
bug #18629 [Cache] fix expiration handling in ArrayAdapter (xabbuh)
This PR was merged into the 3.1-dev branch. Discussion ---------- [Cache] fix expiration handling in ArrayAdapter | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 8b0d990 [Cache] fix expiration handling in ArrayAdapter
2 parents db208e3 + 8b0d990 commit 84b48de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/Cache/Adapter/ArrayAdapter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ public function save(CacheItemInterface $item)
137137
$expiry = $item[CacheItem::CAST_PREFIX.'expiry'];
138138

139139
if (null !== $expiry && $expiry <= time()) {
140+
$this->deleteItem($key);
141+
140142
return true;
141143
}
142144
if ($this->storeSerialized) {

0 commit comments

Comments
 (0)