diff --git a/crates/vise-exporter/src/exporter/mod.rs b/crates/vise-exporter/src/exporter/mod.rs index a185e31..3cedec6 100644 --- a/crates/vise-exporter/src/exporter/mod.rs +++ b/crates/vise-exporter/src/exporter/mod.rs @@ -296,11 +296,12 @@ impl<'a> MetricsExporter<'a> { let mut shutdown = self.shutdown_future; let mut last_error_log_timestamp = None::; loop { + let mut shutdown_requested = false; if tokio::time::timeout(interval, &mut shutdown).await.is_ok() { tracing::info!( "Stop signal received, Prometheus metrics exporter is shutting down" ); - break; + shutdown_requested = true; } let request = Request::builder() @@ -337,6 +338,9 @@ impl<'a> MetricsExporter<'a> { } } } + if shutdown_requested { + break; + } } } }