[pve-devel] applied-series: [PATCH manager 1/2] fix #5067: vzdump: include total backup size in notification

Fiona Ebner f.ebner at proxmox.com
Mon Jan 29 10:38:27 CET 2024


Am 14.12.23 um 15:11 schrieb Lukas Wagner:
> The old backup job notification mails from before the notification
> system overhaul included the total time as well as the total size.
> 
> The total size was missing from the new, template-based backup report,
> thus we add it back in this commit.
> 
> Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
> ---

applied series, thanks!

>  PVE/VZDump.pm | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
> index 4185ed62..91f60418 100644
> --- a/PVE/VZDump.pm
> +++ b/PVE/VZDump.pm
> @@ -414,15 +414,17 @@ sub sanitize_task_list {
>      }
>  }
>  
> -sub count_failed_tasks {
> +my sub aggregate_task_statistics {
>      my ($tasklist) = @_;
>  
>      my $error_count = 0;
> +    my $total_size = 0;
>      for my $task (@$tasklist) {
>  	$error_count++ if $task->{state} ne 'ok';
> +	$total_size += $task->{size} if $task->{state} eq 'ok';
>      }
>  
> -    return $error_count;
> +    return $error_count, $total_size;
>  }

With a small style fix to use parentheses for the list return here.




More information about the pve-devel mailing list