Skip to content

Commit a5a9489

Browse files
committed
Cap metrics scheduling delays to safe minimums
1 parent a133d40 commit a5a9489

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/dev/faststats/core/SimpleMetrics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private void startSubmitting(long initialDelay, long period, TimeUnit unit) {
149149
} catch (Throwable t) {
150150
error("Failed to submit metrics", t);
151151
}
152-
}, initialDelay, period, unit);
152+
}, Math.max(0, initialDelay), Math.max(1000, period), unit);
153153
}
154154

155155
protected boolean isSubmitting() {

0 commit comments

Comments
 (0)