some reengineering to support proper testing

This commit is contained in:
Oliver Gorwits
2017-11-12 00:14:21 +00:00
parent c5f138fe62
commit 2de36c69ba
8 changed files with 110 additions and 73 deletions

View File

@@ -5,9 +5,11 @@ use Dancer::Plugin;
use App::Netdisco::Util::Permission qw/check_acl_no check_acl_only/;
use aliased 'App::Netdisco::Worker::Status';
use Scope::Guard 'guard';
Dancer::Factory::Hook->instance()->install_hooks("nd2_core_${_}")
for qw/check early main user/;
register 'register_worker' => sub {
my ($self, $first, $second) = plugin_args(@_);
@@ -76,7 +78,7 @@ register 'register_worker' => sub {
};
# store the built worker as Worker.pm will build the dispatch order later on
push @{ vars->{'workers'}
push @{ vars->{'workers'}->{$workerconf->{action}}
->{$workerconf->{phase}}
->{$workerconf->{namespace}}
->{$workerconf->{priority}} }, $worker;