@@ -1904,14 +1904,13 @@ pub fn send_http_request(
1904
1904
break ;
1905
1905
}
1906
1906
1907
- if Instant :: now ( ) . saturating_duration_since ( start ) > timeout {
1907
+ if start . elapsed ( ) >= timeout {
1908
1908
return Err ( io:: Error :: new (
1909
1909
io:: ErrorKind :: WouldBlock ,
1910
1910
"Timed out while sending request" ,
1911
1911
) ) ;
1912
1912
}
1913
- // Heartbeat log
1914
- if Instant :: now ( ) . saturating_duration_since ( last_heartbeat_time) >= HEARTBEAT_INTERVAL {
1913
+ if last_heartbeat_time. elapsed ( ) >= HEARTBEAT_INTERVAL {
1915
1914
info ! (
1916
1915
"send_request(sending data): heartbeat - still sending request to {} path='{}' (elapsed: {:?})" ,
1917
1916
addr, request_path, start. elapsed( )
@@ -1957,14 +1956,13 @@ pub fn send_http_request(
1957
1956
} ;
1958
1957
request_handle = rh;
1959
1958
1960
- if Instant :: now ( ) . saturating_duration_since ( start ) > timeout {
1959
+ if start . elapsed ( ) >= timeout {
1961
1960
return Err ( io:: Error :: new (
1962
1961
io:: ErrorKind :: WouldBlock ,
1963
1962
"Timed out while receiving response" ,
1964
1963
) ) ;
1965
1964
}
1966
- // Heartbeat log
1967
- if Instant :: now ( ) . saturating_duration_since ( last_heartbeat_time) >= HEARTBEAT_INTERVAL {
1965
+ if last_heartbeat_time. elapsed ( ) >= HEARTBEAT_INTERVAL {
1968
1966
info ! (
1969
1967
"send_request(receiving data): heartbeat - still receiving response from {} path='{}' (elapsed: {:?})" ,
1970
1968
addr, request_path, start. elapsed( )
0 commit comments