]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: unlock BuildEnvirnoment when build is done
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 16 Sep 2016 16:22:35 +0000 (17:22 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 20 Sep 2016 14:18:51 +0000 (15:18 +0100)
There is no need to lock build environment before changing
build status as this operation is very fast. However, there
is a need to unlock it after changing build status.

Explicitly unlocked BuildEnvironment after build reaches
final status SUCCEEDED, FAILED or CANCELLED. This should
allow runbuilds process to pickup next build faster.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui/buildinfohelper.py

index c93ee94d2c4d97d68dbe609d493b124b2bf530f4..22469607d6a1d805e0aa0b2ba05d660686d1c61f 100644 (file)
@@ -1524,9 +1524,7 @@ class BuildInfoHelper(object):
             return
 
         br_id, be_id = self.brbe.split(":")
-        be = BuildEnvironment.objects.get(pk = be_id)
-        be.lock = BuildEnvironment.LOCK_LOCK
-        be.save()
+
         br = BuildRequest.objects.get(pk = br_id)
 
         # if we're 'done' because we got cancelled update the build outcome
@@ -1543,6 +1541,10 @@ class BuildInfoHelper(object):
         else:
             br.state = BuildRequest.REQ_FAILED
         br.save()
+
+        be = BuildEnvironment.objects.get(pk = be_id)
+        be.lock = BuildEnvironment.LOCK_FREE
+        be.save()
         signal_runbuilds()
 
     def store_log_error(self, text):