diff --git a/src/Traits/Caching.php b/src/Traits/Caching.php index f85a54b..9748082 100644 --- a/src/Traits/Caching.php +++ b/src/Traits/Caching.php @@ -241,7 +241,7 @@ protected function checkCooldownAndRemoveIfExpired(Model $instance) if ( ! $cacheCooldown - || (new Carbon)->now()->diffInSeconds($invalidatedAt) < $cacheCooldown + || (new Carbon)->now()->diffInSeconds($invalidatedAt, true) < $cacheCooldown ) { return; } @@ -285,7 +285,7 @@ protected function checkCooldownAndFlushAfterPersisting(Model $instance, string $this->setCacheCooldownSavedAtTimestamp($instance); - if ((new Carbon)->now()->diffInSeconds($invalidatedAt) >= $cacheCooldown) { + if ((new Carbon)->now()->diffInSeconds($invalidatedAt, true) >= $cacheCooldown) { $instance->flushCache(); if ($relationship) {