From d3790cadcd35d952815826144e2d7092dd0a6add Mon Sep 17 00:00:00 2001 From: David Maicher Date: Fri, 4 May 2018 21:08:14 +0200 Subject: [PATCH] [Cache] fix logic for fetching tag versions on TagAwareAdapter --- src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php | 1 + .../Component/Cache/Tests/Adapter/TagAwareAdapterTest.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php b/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php index 67f9477ae3632..62f815e0171ad 100644 --- a/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php @@ -345,6 +345,7 @@ private function getTagVersions(array $tagsByKey, array &$invalidatedTags = arra foreach ($tagVersions as $tag => $version) { $tags[$tag.static::TAGS_PREFIX] = $tag; if ($fetchTagVersions || !isset($this->knownTagVersions[$tag])) { + $fetchTagVersions = true; continue; } $version -= $this->knownTagVersions[$tag][1]; diff --git a/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php index 094fa9558bfd5..7074299e7ac34 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/TagAwareAdapterTest.php @@ -69,6 +69,12 @@ public function testInvalidateTags() $this->assertFalse($pool->getItem('i1')->isHit()); $this->assertFalse($pool->getItem('i3')->isHit()); $this->assertTrue($pool->getItem('foo')->isHit()); + + $anotherPoolInstance = $this->createCachePool(); + + $this->assertFalse($anotherPoolInstance->getItem('i1')->isHit()); + $this->assertFalse($anotherPoolInstance->getItem('i3')->isHit()); + $this->assertTrue($anotherPoolInstance->getItem('foo')->isHit()); } public function testInvalidateCommits() pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy