Skip to content

Commit 96dcf3d

Browse files
committed
use a year rather than Duration::MAX
1 parent 3267f1e commit 96dcf3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cmap/worker.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ impl ConnectionPoolWorker {
181181
.as_ref()
182182
.and_then(|opts| opts.background_thread_interval)
183183
.map(|i| match i {
184-
BackgroundThreadInterval::Never => Duration::MAX,
184+
// One year is long enough to count as never for tests, but not so long that it
185+
// will overflow interval math.
186+
BackgroundThreadInterval::Never => Duration::from_secs(31_556_952),
185187
BackgroundThreadInterval::Every(d) => d,
186188
})
187189
.unwrap_or(MAINTENACE_FREQUENCY);

0 commit comments

Comments
 (0)