diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-02-24 17:20:57 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-24 23:35:45 +0000 |
commit | cb23e3043bf5c07f111787287a321df0ece647dd (patch) | |
tree | 7e44457c912b50bf78cc2048d1309f9f46cf2c50 /bitbake/lib/bb/ui | |
parent | 6de6739c4cee68c38b815f8daa948156cf0a7c73 (diff) | |
download | poky-cb23e3043bf5c07f111787287a321df0ece647dd.tar.gz |
bitbake: toasterui: disable autocommit for build logging
This patch disables autocommit for inserting build data,
effectively updating all build data in a single transaction.
This is a purely performance improvement patch, as the transaction
will always be commited.
Similar manual transaction handling in the layer source update
method. Added feedback messages during update method.
[YOCTO #7140]
(Bitbake rev: 3978c819e797f857235499a4b8ec238134f1c028)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 1096ccf4de..967e4bdca2 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -35,6 +35,7 @@ from bb.msg import BBLogFormatter as format | |||
35 | from django.db import models | 35 | from django.db import models |
36 | import logging | 36 | import logging |
37 | 37 | ||
38 | from django.db import transaction | ||
38 | 39 | ||
39 | logger = logging.getLogger("BitBake") | 40 | logger = logging.getLogger("BitBake") |
40 | 41 | ||
@@ -606,7 +607,9 @@ class BuildInfoHelper(object): | |||
606 | self.internal_state = {} | 607 | self.internal_state = {} |
607 | self.internal_state['taskdata'] = {} | 608 | self.internal_state['taskdata'] = {} |
608 | self.task_order = 0 | 609 | self.task_order = 0 |
610 | self.autocommit_step = 1 | ||
609 | self.server = server | 611 | self.server = server |
612 | transaction.set_autocommit(False) | ||
610 | self.orm_wrapper = ORMWrapper() | 613 | self.orm_wrapper = ORMWrapper() |
611 | self.has_build_history = has_build_history | 614 | self.has_build_history = has_build_history |
612 | self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0] | 615 | self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0] |
@@ -926,6 +929,12 @@ class BuildInfoHelper(object): | |||
926 | task_information['outcome'] = Task.OUTCOME_FAILED | 929 | task_information['outcome'] = Task.OUTCOME_FAILED |
927 | del self.internal_state['taskdata'][identifier] | 930 | del self.internal_state['taskdata'][identifier] |
928 | 931 | ||
932 | # we force a sync point here, to get the progress bar to show | ||
933 | if self.autocommit_step % 3 == 0: | ||
934 | transaction.set_autocommit(True) | ||
935 | transaction.set_autocommit(False) | ||
936 | self.autocommit_step += 1 | ||
937 | |||
929 | self.orm_wrapper.get_update_task_object(task_information, True) # must exist | 938 | self.orm_wrapper.get_update_task_object(task_information, True) # must exist |
930 | 939 | ||
931 | 940 | ||
@@ -1197,3 +1206,5 @@ class BuildInfoHelper(object): | |||
1197 | # we have no build, and we still have events; something amazingly wrong happend | 1206 | # we have no build, and we still have events; something amazingly wrong happend |
1198 | for event in self.internal_state['backlog']: | 1207 | for event in self.internal_state['backlog']: |
1199 | logger.error("UNSAVED log: %s", event.msg) | 1208 | logger.error("UNSAVED log: %s", event.msg) |
1209 | |||
1210 | transaction.set_autocommit(True) | ||