fix bug in reuse of $worker for prefix actions

This commit is contained in:
Oliver Gorwits
2018-06-07 21:50:43 +01:00
parent e4098ad3d7
commit 596d2454d6

View File

@@ -101,7 +101,6 @@ unless ($action) {
use Moo; use Moo;
with 'App::Netdisco::Worker::Runner'; with 'App::Netdisco::Worker::Runner';
} }
my $worker = MyWorker->new();
my $net = NetAddr::IP->new($device); my $net = NetAddr::IP->new($device);
if ($device and (!$net or $net->num == 0 or $net->addr eq '0.0.0.0')) { if ($device and (!$net or $net->num == 0 or $net->addr eq '0.0.0.0')) {
@@ -137,6 +136,7 @@ if ($queue_only) {
} }
else { else {
foreach my $spec (@job_specs) { foreach my $spec (@job_specs) {
my $worker = MyWorker->new();
my $job = App::Netdisco::Backend::Job->new({ job => 0, %$spec }); my $job = App::Netdisco::Backend::Job->new({ job => 0, %$spec });
my $actiontext = ( my $actiontext = (