summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-06-17 17:30:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-26 09:27:32 +0100
commit70c4eb8d3acaad267ee943ebfba793f9cc1c5ee6 (patch)
tree416f9dcf9c16014e1fc2b975a1de01b286847e25 /bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
parent287b49a35b3f06b302ee199ed4b2d123f1aae58c (diff)
downloadpoky-70c4eb8d3acaad267ee943ebfba793f9cc1c5ee6.tar.gz
bitbake: toaster: refactor build model
We remove the "timespent", "errors_no" and "warnings_no" fields in favor of computing the needed values at runtime. This prevents inconsistencies in the UI. Also removeing all references to BuildRequests from the interface - all build details now display in the build dashboard. Minor fixes related to data logging. (Bitbake rev: 44f37394ed3e4ca02f940be172fe4395b0ee0f7d) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py')
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
index bcf3b04cf0..33cc94ea89 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -107,20 +107,24 @@ class Command(NoArgsCommand):
107 def cleanup(self): 107 def cleanup(self):
108 from django.utils import timezone 108 from django.utils import timezone
109 from datetime import timedelta 109 from datetime import timedelta
110 # DISABLED environments locked for more than 30 seconds - they should be unlocked 110 # environments locked for more than 30 seconds - they should be unlocked
111 #BuildEnvironment.objects.filter(lock=BuildEnvironment.LOCK_LOCK).filter(updated__lt = timezone.now() - timedelta(seconds = 30)).update(lock = BuildEnvironment.LOCK_FREE) 111 BuildEnvironment.objects.filter(buildrequest__state__in=[BuildRequest.REQ_FAILED, BuildRequest.REQ_COMPLETED]).filter(lock=BuildEnvironment.LOCK_LOCK).filter(updated__lt = timezone.now() - timedelta(seconds = 30)).update(lock = BuildEnvironment.LOCK_FREE)
112 112
113 113
114 # update all Builds that failed to start 114 # update all Builds that failed to start
115 115
116 for br in BuildRequest.objects.filter(state = BuildRequest.REQ_FAILED, build__outcome = Build.IN_PROGRESS): 116 for br in BuildRequest.objects.filter(state = BuildRequest.REQ_FAILED, build__outcome = Build.IN_PROGRESS):
117 br.build.outcome = Build.FAILED
118 # transpose the launch errors in ToasterExceptions 117 # transpose the launch errors in ToasterExceptions
118 br.build.outcome = Build.FAILED
119 for brerror in br.brerror_set.all(): 119 for brerror in br.brerror_set.all():
120 logger.debug("Saving error %s" % brerror) 120 logger.debug("Saving error %s" % brerror)
121 LogMessage.objects.create(build = br.build, level = LogMessage.EXCEPTION, message = brerror.errmsg) 121 LogMessage.objects.create(build = br.build, level = LogMessage.EXCEPTION, message = brerror.errmsg)
122 br.build.save() 122 br.build.save()
123 123
124 # we don't have a true build object here; hence, toasterui didn't have a change to release the BE lock
125 br.environment.lock = BuildEnvironment.LOCK_FREE
126 br.environment.save()
127
124 128
125 129
126 # update all BuildRequests without a build created 130 # update all BuildRequests without a build created