make sure internal plugin asciibetical load order is preserved

This commit is contained in:
Oliver Gorwits
2023-09-27 14:13:40 +01:00
parent 582163aa3e
commit 3a160206a1
2 changed files with 4 additions and 2 deletions

View File

@@ -49,7 +49,9 @@ sub load_workers {
and exists vars->{'workers'}->{'internal'}->{$phase};
my $internal = vars->{'workers'}->{'internal'};
foreach my $namespace (keys %{ $internal->{$phase} }) {
# the namespace of an internal worker is actually the worker name so must
# be sorted in order to "preserve" the plugin load order
foreach my $namespace (sort keys %{ $internal->{$phase} }) {
foreach my $priority (keys %{ $internal->{$phase}->{$namespace} }) {
push @{ $workers->{$phase}->{'__internal__'}->{$priority} },
@{ $internal->{$phase}->{$namespace}->{$priority} };

View File

@@ -108,7 +108,7 @@ register 'register_worker' => sub {
push @{ vars->{'workers'}->{$workerconf->{action}}
->{$workerconf->{phase}}
->{$workerconf->{namespace}}
->{$workerconf->{priority}} }, $worker;
->{$workerconf->{priority}} }, { conf => $workerconf, go => $worker };
};
sub _find_matchaction {