summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index c0f42d2dcb..19ddd8e029 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -35,7 +35,7 @@ from bb.msg import BBLogFormatter as format
35from django.db import models 35from django.db import models
36import logging 36import logging
37 37
38from django.db import transaction 38from django.db import transaction, connection
39 39
40logger = logging.getLogger("BitBake") 40logger = logging.getLogger("BitBake")
41 41
@@ -609,7 +609,9 @@ class BuildInfoHelper(object):
609 self.task_order = 0 609 self.task_order = 0
610 self.autocommit_step = 1 610 self.autocommit_step = 1
611 self.server = server 611 self.server = server
612 transaction.set_autocommit(False) 612 # we use manual transactions if the database doesn't autocommit on us
613 if not connection.features.autocommits_when_autocommit_is_off:
614 transaction.set_autocommit(False)
613 self.orm_wrapper = ORMWrapper() 615 self.orm_wrapper = ORMWrapper()
614 self.has_build_history = has_build_history 616 self.has_build_history = has_build_history
615 self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0] 617 self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
@@ -929,11 +931,12 @@ class BuildInfoHelper(object):
929 task_information['outcome'] = Task.OUTCOME_FAILED 931 task_information['outcome'] = Task.OUTCOME_FAILED
930 del self.internal_state['taskdata'][identifier] 932 del self.internal_state['taskdata'][identifier]
931 933
932 # we force a sync point here, to get the progress bar to show 934 if not connection.features.autocommits_when_autocommit_is_off:
933 if self.autocommit_step % 3 == 0: 935 # we force a sync point here, to get the progress bar to show
934 transaction.set_autocommit(True) 936 if self.autocommit_step % 3 == 0:
935 transaction.set_autocommit(False) 937 transaction.set_autocommit(True)
936 self.autocommit_step += 1 938 transaction.set_autocommit(False)
939 self.autocommit_step += 1
937 940
938 self.orm_wrapper.get_update_task_object(task_information, True) # must exist 941 self.orm_wrapper.get_update_task_object(task_information, True) # must exist
939 942
@@ -1207,4 +1210,5 @@ class BuildInfoHelper(object):
1207 for event in self.internal_state['backlog']: 1210 for event in self.internal_state['backlog']:
1208 logger.error("UNSAVED log: %s", event.msg) 1211 logger.error("UNSAVED log: %s", event.msg)
1209 1212
1210 transaction.set_autocommit(True) 1213 if not connection.features.autocommits_when_autocommit_is_off:
1214 transaction.set_autocommit(True)