diff --git a/src/host/proxmox.rs b/src/host/proxmox.rs index fa35273..ee84146 100644 --- a/src/host/proxmox.rs +++ b/src/host/proxmox.rs @@ -80,7 +80,7 @@ impl ProxmoxClient { .await?; let status = rsp.status(); let text = rsp.text().await?; - info!("<< {}", text); + //info!("<< {}", text); if status.is_success() { Ok(serde_json::from_str(&text)?) } else { @@ -100,7 +100,7 @@ impl ProxmoxClient { .await?; let status = rsp.status(); let text = rsp.text().await?; - info!("<< {}", text); + //info!("<< {}", text); if status.is_success() { Ok(serde_json::from_str(&text)?) } else { diff --git a/src/worker.rs b/src/worker.rs index e326f99..0c564d6 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -3,6 +3,7 @@ use crate::provisioner::lnvps::LNVpsProvisioner; use crate::provisioner::Provisioner; use crate::status::{VmRunningState, VmState, VmStateCache}; use anyhow::{bail, Result}; +use chrono::Utc; use fedimint_tonic_lnd::Client; use ipnetwork::IpNetwork; use lnvps_db::{LNVpsDb, Vm, VmHost}; @@ -137,7 +138,9 @@ impl Worker { } Err(e) => { warn!("Failed to get VM status: {}", e); - self.spawn_vm(&vm, &host, &client).await?; + if vm.expires > Utc::now() { + self.spawn_vm(&vm, &host, &client).await?; + } } } Ok(())