mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 23:20:24 +00:00
5to6: get_pkg: cache version list
this is a short running script, so the version list can be re-used, the chance that there where updates in between are slim and racy anyway. IF getting the versions did not succeeded, we still retry on every call though, simpler and ensures a warning is printed in the caller check vicinity. Makes script noticeable faster. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
f034380db0
commit
7d1b353b09
@ -80,10 +80,11 @@ sub print_header {
|
||||
$print_header_first = 0;
|
||||
}
|
||||
|
||||
my $versions;
|
||||
my $get_pkg = sub {
|
||||
my ($pkg) = @_;
|
||||
|
||||
my $versions = eval { PVE::API2::APT->versions({ node => $nodename }); };
|
||||
$versions = eval { PVE::API2::APT->versions({ node => $nodename }) } if !defined($versions);
|
||||
|
||||
if (!defined($versions)) {
|
||||
my $msg = "unable to retrieve package version information";
|
||||
|
Loading…
Reference in New Issue
Block a user