diff options
author | Jonathan "Duke" Leto <jonathan@leto.net> | 2011-01-05 13:36:16 -0800 |
---|---|---|
committer | Jonathan "Duke" Leto <jonathan@leto.net> | 2011-01-05 13:36:16 -0800 |
commit | ef58ac688c1cbfbb88be1ff211a23438a90ef882 (patch) | |
tree | 1b79f1ba15f395e68d00c6741ccd8c08078381a9 /lib | |
parent | Attempt to avoid a race condition and emit more debug info (diff) | |
download | jitterbug-ef58ac688c1cbfbb88be1ff211a23438a90ef882.tar.gz |
Find new tasks correctly
Diffstat (limited to '')
-rw-r--r-- | lib/jitterbug/Builder.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 6442e48..0cd3d6b 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -53,10 +53,11 @@ sub run { sub build { my $self = shift; - my @tasks = $self->{'schema'}->resultset('Task')->all(); while (1) { + my @tasks = $self->{'schema'}->resultset('Task')->all(); debug("Found " . scalar(@tasks) . " tasks"); + foreach my $task (@tasks) { $task ? $self->run_task($task) : $self->sleep; } |