Skip to content

Commit 0a8b489

Browse files
committed
fixup! address another review comment
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
1 parent dd578dc commit 0a8b489

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

observer/bin/spark-observer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ const loop = async (name, fn, interval) => {
5151
point.intField('delay_ms', interval - dt)
5252
})
5353

54-
// This is safe to do because setTimeout(-10) has the same result as setTimeout(0)
55-
await timers.setTimeout(interval - dt)
54+
if (dt < interval) {
55+
await timers.setTimeout(interval - dt)
56+
}
5657
}
5758
}
5859

0 commit comments

Comments
 (0)