no need for Array::Iterator even though it was cute
This commit is contained in:
@@ -4,7 +4,6 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Module::Load ();
|
use Module::Load ();
|
||||||
use Array::Iterator;
|
|
||||||
use Dancer qw/:moose :syntax/;
|
use Dancer qw/:moose :syntax/;
|
||||||
|
|
||||||
use Moo::Role;
|
use Moo::Role;
|
||||||
@@ -49,7 +48,7 @@ sub load_workers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->$pname( Array::Iterator->new({ __array__ => \@wset }) );
|
$self->$pname( \@wset );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,12 +68,12 @@ sub run_workers {
|
|||||||
|
|
||||||
my $set = shift
|
my $set = shift
|
||||||
or return $job->add_status( Status->error('missing set param') );
|
or return $job->add_status( Status->error('missing set param') );
|
||||||
return unless ref $self->$set and $self->$set->get_length();
|
return unless ref [] eq ref $self->$set and 0 < scalar @{ $self->$set };
|
||||||
|
|
||||||
(my $phase = $set) =~ s/^workers_//;
|
(my $phase = $set) =~ s/^workers_//;
|
||||||
$job->enter_phase($phase);
|
$job->enter_phase($phase);
|
||||||
|
|
||||||
while (my $worker = $self->$set->get_next()) {
|
foreach my $worker (@{ $self->$set }) {
|
||||||
try { $job->add_status( $worker->($job) ) }
|
try { $job->add_status( $worker->($job) ) }
|
||||||
catch {
|
catch {
|
||||||
debug "=> $_" if $_;
|
debug "=> $_" if $_;
|
||||||
|
|||||||
Reference in New Issue
Block a user