From 818c4fdc42fefc1890474cc7c48448117d705bf8 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 30 Oct 2020 10:07:39 -0400 Subject: [PATCH] The key should be forgotten, not flushed. Flush clears the entire blink cache. --- src/Entries/Collection.php | 2 +- tests/Data/Entries/CollectionTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entries/Collection.php b/src/Entries/Collection.php index 89037ce373..31bab13e3a 100644 --- a/src/Entries/Collection.php +++ b/src/Entries/Collection.php @@ -320,7 +320,7 @@ public function save() { Facades\Collection::save($this); - Blink::flush('collection-handles'); + Blink::forget('collection-handles'); Blink::flushStartingWith("collection-{$this->id()}"); if ($this->hasStructure()) { // todo: only if the structure changed. diff --git a/tests/Data/Entries/CollectionTest.php b/tests/Data/Entries/CollectionTest.php index 4faf435004..936b490454 100644 --- a/tests/Data/Entries/CollectionTest.php +++ b/tests/Data/Entries/CollectionTest.php @@ -292,7 +292,7 @@ public function it_saves_the_collection_through_the_api() $collection = (new Collection)->handle('test'); Facades\Collection::shouldReceive('save')->with($collection)->once(); - Facades\Blink::shouldReceive('flush')->with('collection-handles')->once(); + Facades\Blink::shouldReceive('forget')->with('collection-handles')->once(); Facades\Blink::shouldReceive('flushStartingWith')->with('collection-test')->once(); $return = $collection->save();