mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-19 23:36:03 +00:00
Jobs: include existing types in state file regex for deletion
otherwise, we cannot correctly match types that contain a hyphen, since the id itself can also contain those. creating a regex where the first part is the concrete allowed types followed by a hyphen + id can also match those. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
63d74bb632
commit
a1c51a74ca
@ -324,7 +324,10 @@ sub synchronize_job_states_with_config {
|
||||
}
|
||||
}
|
||||
|
||||
PVE::Tools::dir_glob_foreach($state_dir, '(.*?)-(.*).json', sub {
|
||||
my $valid_types = PVE::Job::Registry->lookup_types();
|
||||
my $type_regex = join("|", $valid_types->@*);
|
||||
|
||||
PVE::Tools::dir_glob_foreach($state_dir, "(${type_regex})-(.*).json", sub {
|
||||
my ($path, $type, $id) = @_;
|
||||
|
||||
if (!defined($data->{ids}->{$id})) {
|
||||
|
Loading…
Reference in New Issue
Block a user