Skip to content

Commit 7ce91c9

Browse files
committed
DowntimeStore: be more paranoid about duplicate ts
1 parent 1aace91 commit 7ce91c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/Eventtracker/Engine/Downtime/DowntimeStore.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ protected static function safeNow(?int $now): int
217217
if ($now === null) {
218218
$now = Time::unixMilli();
219219
}
220-
if ($now === self::$lastNow) {
220+
if ($now < self::$lastNow && self::$lastNow - $now < 300_000) {
221+
$now = self::$lastNow + 1;
222+
} elseif ($now === self::$lastNow) {
221223
$now += 1;
222224
}
223225

0 commit comments

Comments
 (0)