Skip to content

Commit 64391e3

Browse files
committed
TaggedCache actually flushes tags instead of reseting them
1 parent 41ac7e8 commit 64391e3

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/Illuminate/Cache/TagSet.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,26 @@ public function resetTag($name)
5656
return $id;
5757
}
5858

59+
/**
60+
* Flush all tags in the set.
61+
*
62+
* @return void
63+
*/
64+
public function flush()
65+
{
66+
array_walk($this->names, [$this, 'flushTag']);
67+
}
68+
69+
/**
70+
* Flush the tag from cache.
71+
*
72+
* @param string $name
73+
*/
74+
public function resetTag($name)
75+
{
76+
$this->store->forget($this->tagKey($name));
77+
}
78+
5979
/**
6080
* Get a unique namespace that changes when any of the tags are flushed.
6181
*

src/Illuminate/Cache/TaggedCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function decrement($key, $value = 1)
7878
*/
7979
public function flush()
8080
{
81-
$this->tags->reset();
81+
$this->tags->flush();
8282

8383
return true;
8484
}

0 commit comments

Comments
 (0)