Skip to content

Commit 68a7cbf

Browse files
author
Felipe Araujo
committed
Fix a bug where not caching made everything blow up
1 parent 36a94da commit 68a7cbf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Cache.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ private function calculateTtl($ttl): int
179179
*/
180180
private function protectLifetimeFromStampede(int $ttl): int
181181
{
182+
if ($ttl < 0) {
183+
return $ttl;
184+
}
185+
182186
$ten = (int) floor($ttl / 10);
183187
$modifier = random_int(0, $ten);
184188
$modifier = min($modifier, 120);

0 commit comments

Comments
 (0)