Skip to content

Commit

Permalink
The key should be forgotten, not flushed. Flush clears the entire bli…
Browse files Browse the repository at this point in the history
…nk cache.
  • Loading branch information
jasonvarga committed Oct 30, 2020
1 parent 3bba317 commit 818c4fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Entries/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/Data/Entries/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 818c4fd

Please sign in to comment.