]> git.proxmox.com Git - pve-manager.git/commitdiff
api: task download: improve code/comment locallity slightly
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 Jan 2023 13:38:19 +0000 (14:38 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 Jan 2023 13:38:19 +0000 (14:38 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Tasks.pm

index cdd2e55c8414ed80f82fc1a087d4852a13957799..9c8de324db1714d95865666698c04243c5877033 100644 (file)
@@ -394,11 +394,10 @@ __PACKAGE__->register_method({
            if (defined($param->{start}) || defined($param->{limit})) {
                die "'download' cannot be used together with 'start' or 'limit' parameters\n";
            }
-
-           my $fh;
+           # 1024 is a practical cutoff for the size distribution of our log files.
            my $use_compression = ( -s $filename ) > 1024;
 
-           # 1024 is a practical cutoff for the size distribution of our log files.
+           my $fh;
            if ($use_compression) {
                open($fh, "-|", "/usr/bin/gzip", "-c", "$filename")
                    or die "Could not create compressed file stream for file '$filename' - $!\n";