only take one job at a time per worker
This commit is contained in:
@@ -20,11 +20,11 @@ sub worker_body {
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
prctl sprintf 'netdisco-daemon: worker #%s %s: idle', $wid, lc($type);
|
prctl sprintf 'netdisco-daemon: worker #%s %s: idle', $wid, lc($type);
|
||||||
my $jobs = [ $self->{queue}->dequeue(1) ]; # FIXME multiple take, take type, thaw
|
|
||||||
|
|
||||||
foreach my $job (@$jobs) {
|
my $job = $self->{queue}->dequeue(1);
|
||||||
next unless defined $job;
|
next unless defined $job;
|
||||||
$job = schema('daemon')->dclone( $job );
|
|
||||||
|
$job = schema('daemon')->dclone( $job ); # TODO stop using DBIC
|
||||||
my $target = $self->munge_action($job->action);
|
my $target = $self->munge_action($job->action);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -45,7 +45,6 @@ sub worker_body {
|
|||||||
|
|
||||||
$self->close_job($job);
|
$self->close_job($job);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub close_job {
|
sub close_job {
|
||||||
|
|||||||
@@ -101,10 +101,6 @@ jobs from the queue.
|
|||||||
|
|
||||||
=head2 id (auto)
|
=head2 id (auto)
|
||||||
|
|
||||||
=head2 type (required)
|
|
||||||
|
|
||||||
=head2 wid (required, default 0)
|
|
||||||
|
|
||||||
=head2 entered
|
=head2 entered
|
||||||
|
|
||||||
=head2 started
|
=head2 started
|
||||||
|
|||||||
Reference in New Issue
Block a user