diff options
author | Alex <alex@adnab.me> | 2022-10-02 16:41:06 +0200 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-10-02 16:41:06 +0200 |
commit | a096ced35562bd0a8877a1ee2f755be1edafe343 (patch) | |
tree | b2a427054a30f23d512d63d895a4ddd8a98f46e2 /src/rpc/system.rs | |
parent | e21b672c96da3c6d01a5ef964aa0ad7a38f8e74c (diff) | |
parent | ad917ffd3f76316e48b89ff17e2f8a600a269481 (diff) | |
download | garage-a096ced35562bd0a8877a1ee2f755be1edafe343.tar.gz garage-a096ced35562bd0a8877a1ee2f755be1edafe343.zip |
Merge pull request 'Fix instant substractions that might have panicked' (#398) from fix-time into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/398
Diffstat (limited to 'src/rpc/system.rs')
-rw-r--r-- | src/rpc/system.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/system.rs b/src/rpc/system.rs index f8121193..9e0bfa11 100644 --- a/src/rpc/system.rs +++ b/src/rpc/system.rs @@ -369,7 +369,9 @@ impl System { id: n.id.into(), addr: n.addr, is_up: n.is_up(), - last_seen_secs_ago: n.last_seen.map(|t| (Instant::now() - t).as_secs()), + last_seen_secs_ago: n + .last_seen + .map(|t| (Instant::now().saturating_duration_since(t)).as_secs()), status: node_status .get(&n.id.into()) .cloned() |