From f629a56c4760eb2b7107618c07d69956dbe1e9f3 Mon Sep 17 00:00:00 2001 From: Lukas Wagner Date: Fri, 9 Aug 2024 10:19:50 +0200 Subject: [PATCH] daily-update: initialize context for notification system Otherwise proxmox-daily-update panics if attempting to send a notification for any available new updates: "context for proxmox-notify has not been set yet" Reported on our community forum: https://forum.proxmox.com/threads/152429/ Signed-off-by: Lukas Wagner --- src/bin/proxmox-daily-update.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/proxmox-daily-update.rs b/src/bin/proxmox-daily-update.rs index 66868dc7..dbfee07b 100644 --- a/src/bin/proxmox-daily-update.rs +++ b/src/bin/proxmox-daily-update.rs @@ -1,6 +1,7 @@ use anyhow::Error; use serde_json::json; +use proxmox_notify::context::pbs::PBS_CONTEXT; use proxmox_router::{cli::*, ApiHandler, RpcEnvironment}; use proxmox_subscription::SubscriptionStatus; use proxmox_sys::fs::CreateOptions; @@ -101,6 +102,8 @@ async fn run(rpcenv: &mut dyn RpcEnvironment) -> Result<(), Error> { proxmox_rest_server::register_task_control_commands(&mut command_sock)?; command_sock.spawn(proxmox_rest_server::last_worker_future())?; + proxmox_notify::context::set_context(&PBS_CONTEXT); + do_update(rpcenv).await }