about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorJonathan "Duke" Leto <jonathan@leto.net>2011-01-05 13:36:16 -0800
committerJonathan "Duke" Leto <jonathan@leto.net>2011-01-05 13:36:16 -0800
commitef58ac688c1cbfbb88be1ff211a23438a90ef882 (patch)
tree1b79f1ba15f395e68d00c6741ccd8c08078381a9 /lib
parentAttempt to avoid a race condition and emit more debug info (diff)
downloadjitterbug-ef58ac688c1cbfbb88be1ff211a23438a90ef882.tar.gz
Find new tasks correctly
Diffstat (limited to 'lib')
-rw-r--r--lib/jitterbug/Builder.pm3
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;
         }