feat: added longer timer
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-11-24 01:13:09 +01:00
parent 32cd1cc617
commit deceaad4d1
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394

View File

@ -23,7 +23,7 @@ impl notmad::Component for AgentRefresh {
&self, &self,
cancellation_token: tokio_util::sync::CancellationToken, cancellation_token: tokio_util::sync::CancellationToken,
) -> Result<(), notmad::MadError> { ) -> Result<(), notmad::MadError> {
let cancel = nodrift::schedule_drifter(std::time::Duration::from_secs(5), self.clone()); let cancel = nodrift::schedule_drifter(std::time::Duration::from_secs(60), self.clone());
tokio::select! { tokio::select! {
_ = cancel.cancelled() => {}, _ = cancel.cancelled() => {},
_ = cancellation_token.cancelled() => { _ = cancellation_token.cancelled() => {
@ -89,8 +89,8 @@ impl Task {
} }
pub async fn execute(&self) -> anyhow::Result<()> { pub async fn execute(&self) -> anyhow::Result<()> {
let mut cmd = tokio::process::Command::new("apt"); let mut cmd = tokio::process::Command::new("apt-get");
cmd.args(["apt-get", "update", "-q"]); cmd.args(["update", "-q"]);
let output = cmd.output().await.context("failed to run apt update")?; let output = cmd.output().await.context("failed to run apt update")?;
match output.status.success() { match output.status.success() {
true => tracing::info!("successfully ran apt update"), true => tracing::info!("successfully ran apt update"),
@ -102,9 +102,9 @@ impl Task {
} }
} }
let mut cmd = tokio::process::Command::new("apt"); let mut cmd = tokio::process::Command::new("apt-get");
cmd.env("DEBIAN_FRONTEND", "noninteractive") cmd.env("DEBIAN_FRONTEND", "noninteractive")
.args(["apt-get", "upgrade", "-y"]); .args(["upgrade", "-y"]);
let output = cmd.output().await.context("failed to run apt upgrade")?; let output = cmd.output().await.context("failed to run apt upgrade")?;
match output.status.success() { match output.status.success() {
true => tracing::info!("successfully ran apt upgrade"), true => tracing::info!("successfully ran apt upgrade"),