Skip to content

Commit 76d2991

Browse files
authored
fix(apps::vmware::vsphere8): can now recover from a corrupted cache (#6138)
Refs: CTOR-2291
1 parent b9fef83 commit 76d2991

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • src/apps/vmware/vsphere8/custom

src/apps/vmware/vsphere8/custom/api.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ sub get_all_acq_specs {
293293

294294
# store it in the cache for future runs
295295
$self->{acq_specs_cache}->write(data => { updated => time(), acq_specs => $self->{all_acq_specs} });
296+
# in some cases the statefile was corrupted and the plugin was stuck
297+
# only return a result if it looks ok, else we store an empty array
298+
$self->{all_acq_specs} = [] unless ref($self->{all_acq_specs}) eq 'ARRAY' && @{$self->{all_acq_specs}};
296299
return $self->{all_acq_specs};
297300
}
298301

0 commit comments

Comments
 (0)