public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] daily-update: initialize context for notification system
@ 2024-08-09  8:19 Lukas Wagner
  2024-08-09  8:24 ` Lukas Wagner
  2024-08-09  8:55 ` [pbs-devel] applied: " Fabian Grünbichler
  0 siblings, 2 replies; 3+ messages in thread
From: Lukas Wagner @ 2024-08-09  8:19 UTC (permalink / raw)
  To: pbs-devel

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"

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 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
 }
 
-- 
2.39.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup] daily-update: initialize context for notification system
  2024-08-09  8:19 [pbs-devel] [PATCH proxmox-backup] daily-update: initialize context for notification system Lukas Wagner
@ 2024-08-09  8:24 ` Lukas Wagner
  2024-08-09  8:55 ` [pbs-devel] applied: " Fabian Grünbichler
  1 sibling, 0 replies; 3+ messages in thread
From: Lukas Wagner @ 2024-08-09  8:24 UTC (permalink / raw)
  To: pbs-devel

On  2024-08-09 10:19, Lukas Wagner wrote:
> 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"
> 

Forgot the --notes when formatting the patch, here we are:

Reported on our community forum:
https://forum.proxmox.com/threads/152429/

-- 
- Lukas


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup] daily-update: initialize context for notification system
  2024-08-09  8:19 [pbs-devel] [PATCH proxmox-backup] daily-update: initialize context for notification system Lukas Wagner
  2024-08-09  8:24 ` Lukas Wagner
@ 2024-08-09  8:55 ` Fabian Grünbichler
  1 sibling, 0 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2024-08-09  8:55 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion

with forum link folded in, thanks!

On August 9, 2024 10:19 am, Lukas Wagner wrote:
> 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"
> 
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> ---
>  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
>  }
>  
> -- 
> 2.39.2
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-09  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-09  8:19 [pbs-devel] [PATCH proxmox-backup] daily-update: initialize context for notification system Lukas Wagner
2024-08-09  8:24 ` Lukas Wagner
2024-08-09  8:55 ` [pbs-devel] applied: " Fabian Grünbichler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal