Skip to content

Commit 813a29e

Browse files
authored
fix: prevent u64 underflow panic in online instance count
1 parent 5e4ec90 commit 813a29e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

gateway/src/admin_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl AdminRpc for AdminRpcHandler {
157157
.values()
158158
.filter(|(ts, _)| {
159159
// Skip instances that never connected (ts == 0)
160-
*ts != 0 && (now - *ts) < 300
160+
*ts != 0 && now.saturating_sub(*ts) < 300
161161
})
162162
.count();
163163

0 commit comments

Comments
 (0)