fix: bind reboot success to independently received inventory within reserved deadline
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -189,13 +189,10 @@ pub async fn event(
|
||||
}
|
||||
}
|
||||
if matches!(payload.action, Action::Reboot { .. }) {
|
||||
ensure!(
|
||||
evidence.get("new_boot_id").and_then(Value::as_str)
|
||||
== Some(e.boot_id.as_str()),
|
||||
"new boot evidence required"
|
||||
);
|
||||
let old_boot=sqlx::query_scalar::<_,String>("SELECT data->>'boot_id' FROM audit_events WHERE event_type='start_reserved' AND data->>'job_id'=$1 ORDER BY created_at DESC LIMIT 1").bind(&r.job_id).fetch_one(&mut **tx).await?;
|
||||
ensure!(old_boot != e.boot_id, "reboot needs new boot");
|
||||
crate::synchronization::verify_reboot_success(
|
||||
tx, tenant, agent, e, &payload, r, &evidence,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
sqlx::query("UPDATE jobs SET state=$2,revision=$3,result=$4 WHERE job_id=$1")
|
||||
|
||||
Reference in New Issue
Block a user