File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[package ]
22name = " oxybox"
3- version = " 1.0.5 "
3+ version = " 1.0.6 "
44authors = [" Thomas Luijken" ]
55categories = [" command-line-utilities" ]
66description = " A drop in replacement for blackbox exporter for Prometheus, with support for TLS and HTTP/3."
Original file line number Diff line number Diff line change @@ -243,30 +243,38 @@ pub async fn run_probe_loop(
243243 let org_id = org_config. organisation_id . clone ( ) ;
244244 let mimir_endpoint = mimir_endpoint. clone ( ) ;
245245
246- let probe_timeout_duration: Duration = Duration :: from_secs ( org_config. polling_interval_seconds ) ;
247-
248- handles. push ( tokio:: spawn ( tokio:: time:: timeout ( probe_timeout_duration, async move {
249- handle_target_probe (
250- tenant_name,
251- & org_id,
252- & target,
253- & connector,
254- & resolver,
255- & mimir_endpoint,
256- max_org_width,
257- )
258- . await ;
259- } ) ) ) ;
246+ let probe_timeout_duration: Duration =
247+ Duration :: from_secs ( org_config. polling_interval_seconds ) ;
248+
249+ handles. push ( tokio:: spawn ( tokio:: time:: timeout (
250+ probe_timeout_duration,
251+ async move {
252+ handle_target_probe (
253+ tenant_name,
254+ & org_id,
255+ & target,
256+ & connector,
257+ & resolver,
258+ & mimir_endpoint,
259+ max_org_width,
260+ )
261+ . await ;
262+ } ,
263+ ) ) ) ;
260264 }
261265
262266 for handle in handles {
263267 if let Err ( join_err) = handle. await {
264268 log:: error!( "Task panicked: {:?}" , join_err) ;
265269 }
266270 }
267- let elapsed = start_time. elapsed ( ) ;
271+ let elapsed = start_time. elapsed ( ) . as_secs ( ) ;
272+ let wait = org_config
273+ . polling_interval_seconds
274+ . checked_sub ( elapsed)
275+ . unwrap_or ( 0 ) ;
268276
269- sleep ( Duration :: from_secs ( org_config . polling_interval_seconds - elapsed . as_secs ( ) ) ) . await ;
277+ sleep ( Duration :: from_secs ( wait ) ) . await ;
270278 }
271279}
272280
You can’t perform that action at this time.
0 commit comments