]> xenbits.xensource.com Git - osstest.git/commitdiff
share in jobdb: Break out $checkconstraints and move call
authorIan Jackson <iwj@xenproject.org>
Wed, 21 Oct 2020 14:54:20 +0000 (15:54 +0100)
committerIan Jackson <iwj@xenproject.org>
Thu, 22 Oct 2020 16:32:15 +0000 (17:32 +0100)
This must happen after we introduce our new row or it is not
effective!

Signed-off-by: Ian Jackson <iwj@xenproject.org>
Osstest/JobDB/Executive.pm

index f69ce277457721723af05ebeca51303fb06104a8..071f31f16993d11d80bdcafb466ff93c2faddf34 100644 (file)
@@ -582,6 +582,11 @@ END
           VALUES (?,        ?,      ?,      ?,   ?,      ?,     ?     )
 END
 
+    my $checkconstraints = sub {
+       $constraintsq->execute($hostname, $ttaskid);
+       $constraintsq->fetchrow_array() or confess "$hostname ?";
+    };
+
     my $ojvn = "$ho->{Ident}_lifecycle";
 
     if (length $r{$ojvn}) {
@@ -654,8 +659,6 @@ END
                push @lifecycle, "$omarks$otj:$o->{stepno}$osuffix";
            }
        }
-       $constraintsq->execute($hostname, $ttaskid);
-       $constraintsq->fetchrow_array() or confess "$hostname ?";
 
        if (defined $flight) {
            $insertq->execute($hostname, $ttaskid,
@@ -670,6 +673,7 @@ END
                              undef,
                              undef,undef);
        }
+       $checkconstraints->();
     });
 
     if (defined $flight) {