[pbs-devel] [PATCH proxmox-backup] notifications: fix legacy sync notifications

Lukas Wagner l.wagner at proxmox.com
Tue May 21 12:43:30 CEST 2024


Did not test this, but code-wise this looks good. 
Likely a copy-paste mistake which slipped through code review.

Reviewed-by: Lukas Wagner <l.wagner at proxmox.com>

On  2024-05-15 11:58, Gabriel Goller wrote:
> When using the legacy notifications the sync mode would pick up the
> settings from the prune-job, which default to Error. This completely
> disables notifications for successful sync-jobs when using the legacy
> system.
> 
> Motivation: https://forum.proxmox.com/threads/legacy-notification-does-not-send-some-emails.147018/
> 
> Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
> ---
>  src/server/notifications.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/server/notifications.rs b/src/server/notifications.rs
> index d142971b..eea55202 100644
> --- a/src/server/notifications.rs
> +++ b/src/server/notifications.rs
> @@ -332,7 +332,7 @@ pub fn send_sync_status(job: &SyncJobConfig, result: &Result<(), Error>) -> Resu
>      let (email, notify, mode) = lookup_datastore_notify_settings(&job.store);
>      match mode {
>          NotificationMode::LegacySendmail => {
> -            let notify = notify.prune.unwrap_or(Notify::Error);
> +            let notify = notify.sync.unwrap_or(Notify::Always);
>  
>              if notify == Notify::Never || (result.is_ok() && notify == Notify::Error) {
>                  return Ok(());

-- 
- Lukas




More information about the pbs-devel mailing list