summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/management/commands
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/management/commands')
-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