WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 5d4c73e

Browse files
author
Josh Ralph
committed
Restored previous behaviour where running in a runDisabled callback still flushes model caches
1 parent 86cf57d commit 5d4c73e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Traits/Caching.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,14 @@ protected function checkCooldownAndRemoveIfExpired(Model $instance)
263263

264264
protected function checkCooldownAndFlushAfterPersisting(Model $instance, string $relationship = "")
265265
{
266-
if (! $this->isCachable()) {
267-
return;
268-
}
266+
/**
267+
* Our usage of the library currently expects model caches to be flushed in the usual way, even
268+
* whilst code is run in a `runDisabled` callback. Leaving this check in place introduced all
269+
* sorts of issues where caches weren't being flushed where they needed to be.
270+
*/
271+
// if (! $this->isCachable()) {
272+
// return;
273+
// }
269274

270275
[$cacheCooldown, $invalidatedAt] = $instance->getModelCacheCooldown($instance);
271276

0 commit comments

Comments
 (0)