Skip to content

Commit 95f5ec3

Browse files
authored
Merge pull request #656 from bravesasha/patch-2
fix: prevent u64 underflow panic in online instance count
2 parents 1f4dd15 + 813a29e commit 95f5ec3

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)