]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
sim hardware: avoid hard error on usage stats parsing
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 20 Mar 2023 10:05:09 +0000 (11:05 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 20 Mar 2023 10:09:01 +0000 (11:09 +0100)
now that we can automatically derive them from the SID

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/HA/Sim/Hardware.pm

index e33a4c5fc2ef6bd86cf3e4a8d335a5ff2bc38694..e72c87f80a04c807986a0ffcf589f7e75101488b 100644 (file)
@@ -336,7 +336,8 @@ sub read_static_service_stats {
     my ($self) = @_;
 
     my $filename = "$self->{statusdir}/static_service_stats";
-    my $stats = PVE::HA::Tools::read_json_from_file($filename);
+    my $stats = eval { PVE::HA::Tools::read_json_from_file($filename) };
+    $self->log('error', "loading static service stats failed - $@") if $@;
 
     return $stats;
 }