diff mbox series

[OSSTEST,01/16] share in jobdb: Break out $checkconstraints and move call

Message ID 20201022164506.1552-2-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series Bugfixes | expand

Commit Message

Ian Jackson Oct. 22, 2020, 4:44 p.m. UTC
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 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index f69ce277..071f31f1 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -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) {