summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-03-12 13:14:49 -0400
committerDan McGee <dan@archlinux.org>2012-07-08 21:08:04 -0500
commita1ec14fc68282d67c00c79b5aa6aab60461f056a (patch)
tree8dc8b3ecb2d3cb8a63026f15ddb4201e59c3d239 /devel
parent3c906888e2ba9e55cef00dfc61667fb383c9754d (diff)
reporead: disable FULL synchronous writes for sqlite3
At least on Linux, we hit a huge bottleneck waiting for the FULL commit to happen for each added package during reporead operations. It makes much more sense to back this off to FULL level instead, which trades some possible loss of durability for speedier operation. Additionally, no one would possibly be running their production version of this site on sqlite3, right? Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r--devel/management/commands/reporead.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index 43578d4a..e50686b1 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -547,6 +547,12 @@ def read_repo(primary_arch, repo_file, options):
package.name, repo_file, package.arch))
del packages
+ database = router.db_for_write(Package)
+ connection = connections[database]
+ if connection.vendor == 'sqlite':
+ cursor = connection.cursor()
+ cursor.execute('PRAGMA synchronous = NORMAL')
+
logger.info('Starting database updates for %s.', repo_file)
for arch in sorted(packages_arches.keys()):
if filesonly: