diff --git a/src/PVE/Storage/ESXiPlugin.pm b/src/PVE/Storage/ESXiPlugin.pm index d90ffa1..9114c6c 100644 --- a/src/PVE/Storage/ESXiPlugin.pm +++ b/src/PVE/Storage/ESXiPlugin.pm @@ -105,12 +105,20 @@ my sub check_esxi_import_package : prototype() { if !-e $ESXI_LIST_VMS; } +my sub is_old : prototype($) { + my ($file) = @_; + my $mtime = (CORE::stat($file))[9]; + return !defined($mtime) || ($mtime + 60) < CORE::time(); +} + sub get_manifest : prototype($$$;$) { my ($class, $storeid, $scfg, $force_query) = @_; my $rundir = run_path($storeid); my $manifest_file = "$rundir/manifest.json"; + $force_query ||= is_old($manifest_file); + if (!$force_query && -e $manifest_file) { return PVE::Storage::ESXiPlugin::Manifest->new( file_get_contents($manifest_file),