[tools] testbot/Janitor: Load only the relevant tasks when deleting VMs.
Francois Gouget
fgouget at codeweavers.com
Wed Jun 8 09:40:46 CDT 2022
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
testbot/bin/Janitor.pl | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/testbot/bin/Janitor.pl b/testbot/bin/Janitor.pl
index af1123aed..618c31d02 100755
--- a/testbot/bin/Janitor.pl
+++ b/testbot/bin/Janitor.pl
@@ -201,14 +201,14 @@ map { $DeletedVMs{$_} = 1 } @{$VMs->GetKeys()};
if (%DeletedVMs)
{
- foreach my $Task (@{CreateTasks($VMs)->GetItems()})
+ my $Tasks = CreateTasks($VMs);
+ $Tasks->AddFilter("VMName", [keys %DeletedVMs]);
+ foreach my $Task (@{$Tasks->GetItems()})
{
- if (exists $DeletedVMs{$Task->VM->Name})
- {
- Trace "Keeping the ", $Task->VM->Name, " VM for task ", $Task->GetSlashKey(), "\n";
- delete $DeletedVMs{$Task->VM->Name};
- last if (!%DeletedVMs);
- }
+ next if (!exists $DeletedVMs{$Task->VMName});
+ Trace "Keeping the ", $Task->VMName, " VM for task ", $Task->GetSlashKey(), "\n";
+ delete $DeletedVMs{$Task->VMName};
+ last if (!%DeletedVMs);
}
foreach my $VMKey (keys %DeletedVMs)
{
--
2.30.2
More information about the wine-devel
mailing list