change to init, first, second stages

This commit is contained in:
Oliver Gorwits
2017-09-10 16:09:45 +01:00
parent 5f2da69697
commit 64a9491115
34 changed files with 74 additions and 63 deletions

View File

@@ -4,16 +4,28 @@ use Dancer ':syntax';
use App::Netdisco::Worker::Plugin;
use aliased 'App::Netdisco::Worker::Status';
register_worker({ primary => true }, sub {
register_worker({ stage => 'second' }, sub {
my ($job, $workerconf) = @_;
debug 'Test (primary) ran successfully.';
return Status->done('Test (primary) ran successfully.');
debug 'Test (second) ran successfully.';
return Status->done('Test (second) ran successfully.');
});
register_worker({ primary => false }, sub {
register_worker({ stage => 'init' }, sub {
my ($job, $workerconf) = @_;
debug 'Test ran successfully.';
return Status->done('Test ran successfully.');
debug 'Test (init) ran successfully.';
return Status->done('Test (init) ran successfully.');
});
register_worker({ stage => 'first' }, sub {
my ($job, $workerconf) = @_;
debug 'Test (first) ran successfully.';
return Status->done('Test (first) ran successfully.');
});
register_worker(sub {
my ($job, $workerconf) = @_;
debug 'Test (undefined) ran successfully.';
return Status->done('Test (undefined) ran successfully.');
});
true;