]> git.proxmox.com Git - pmg-api.git/commitdiff
api: file backup: indentation and code style fix
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Dec 2022 12:18:34 +0000 (13:18 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Dec 2022 12:18:38 +0000 (13:18 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/API2/Backup.pm

index 172e810f6bca1800b7fe9a57bb906a868a543afa..e2913e746a693d267548390fa459b7f529865765 100644 (file)
@@ -239,19 +239,12 @@ __PACKAGE__->register_method ({
        die "nothing selected - please select what you want to restore (config or database?)\n"
            if !($param->{database} || $param->{config});
 
-       my $worker = sub {
-           my $upid = shift;
-
+       return $rpcenv->fork_worker('restore', undef, $authuser, sub {
            print "starting restore: $filename\n";
-
-           PMG::Backup::pmg_restore($filename, $param->{database},
-                                    $param->{config}, $param->{statistic});
+           PMG::Backup::pmg_restore($filename, $param->{database}, $param->{config}, $param->{statistic});
            print "restore finished\n";
-
            return;
-       };
-
-       return $rpcenv->fork_worker('restore', undef, $authuser, $worker);
+       });
     }});
 
 1;