Skip to content

Commit aedc3b1

Browse files
committed
move to elapsed
1 parent e6da1b9 commit aedc3b1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

stackslib/src/net/httpcore.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,14 +1904,13 @@ pub fn send_http_request(
19041904
break;
19051905
}
19061906

1907-
if Instant::now().saturating_duration_since(start) > timeout {
1907+
if start.elapsed() >= timeout {
19081908
return Err(io::Error::new(
19091909
io::ErrorKind::WouldBlock,
19101910
"Timed out while sending request",
19111911
));
19121912
}
1913-
// Heartbeat log
1914-
if Instant::now().saturating_duration_since(last_heartbeat_time) >= HEARTBEAT_INTERVAL {
1913+
if last_heartbeat_time.elapsed() >= HEARTBEAT_INTERVAL {
19151914
info!(
19161915
"send_request(sending data): heartbeat - still sending request to {} path='{}' (elapsed: {:?})",
19171916
addr, request_path, start.elapsed()
@@ -1957,14 +1956,13 @@ pub fn send_http_request(
19571956
};
19581957
request_handle = rh;
19591958

1960-
if Instant::now().saturating_duration_since(start) > timeout {
1959+
if start.elapsed() >= timeout {
19611960
return Err(io::Error::new(
19621961
io::ErrorKind::WouldBlock,
19631962
"Timed out while receiving response",
19641963
));
19651964
}
1966-
// Heartbeat log
1967-
if Instant::now().saturating_duration_since(last_heartbeat_time) >= HEARTBEAT_INTERVAL {
1965+
if last_heartbeat_time.elapsed() >= HEARTBEAT_INTERVAL {
19681966
info!(
19691967
"send_request(receiving data): heartbeat - still receiving response from {} path='{}' (elapsed: {:?})",
19701968
addr, request_path, start.elapsed()

0 commit comments

Comments
 (0)