MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / auto_restart_task

Function auto_restart_task

vmm/src/main.rs:132–146  ·  view source on GitHub ↗
(app: App)

Source from the content-addressed store, hash-verified

130}
131
132async fn auto_restart_task(app: App) {
133 if !app.config.cvm.auto_restart.enabled {
134 info!("Auto restart CVMs is disabled");
135 return;
136 }
137 let mut interval =
138 tokio::time::interval(Duration::from_secs(app.config.cvm.auto_restart.interval));
139 loop {
140 info!("Checking for exited VMs");
141 if let Err(err) = app.try_restart_exited_vms().await {
142 error!("Failed to restart exited VMs: {err:?}");
143 }
144 interval.tick().await;
145 }
146}
147
148#[rocket::main]
149async fn main() -> Result<()> {

Callers 1

mainFunction · 0.85

Calls 1

Tested by

no test coverage detected