mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
only sleep for 1 second before first health check
This commit is contained in:
committed by
Aiden McClelland
parent
b29060e0af
commit
7df953d5fb
@@ -264,8 +264,8 @@ async fn run_main(
|
|||||||
.commit_health_check_results
|
.commit_health_check_results
|
||||||
.store(true, Ordering::SeqCst);
|
.store(true, Ordering::SeqCst);
|
||||||
let health = async {
|
let health = async {
|
||||||
|
tokio::time::sleep(Duration::from_secs(1)).await; // only sleep for 1 second before first health check
|
||||||
loop {
|
loop {
|
||||||
tokio::time::sleep(Duration::from_secs(HEALTH_CHECK_COOLDOWN_SECONDS)).await;
|
|
||||||
let mut db = state.ctx.db.handle();
|
let mut db = state.ctx.db.handle();
|
||||||
if let Err(e) = health::check(
|
if let Err(e) = health::check(
|
||||||
&state.ctx,
|
&state.ctx,
|
||||||
@@ -282,6 +282,7 @@ async fn run_main(
|
|||||||
);
|
);
|
||||||
tracing::debug!("{:?}", e);
|
tracing::debug!("{:?}", e);
|
||||||
}
|
}
|
||||||
|
tokio::time::sleep(Duration::from_secs(HEALTH_CHECK_COOLDOWN_SECONDS)).await;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let _ = state
|
let _ = state
|
||||||
|
|||||||
Reference in New Issue
Block a user