summaryrefslogtreecommitdiff
path: root/qutebrowser/browser
diff options
context:
space:
mode:
authorlufte <javier@lufte.net>2021-06-27 17:40:04 -0300
committerlufte <javier@lufte.net>2021-06-27 17:40:04 -0300
commit5a522e9c978c1d4ed7d21256dd36c98b3ef730af (patch)
tree9970a6bfc38d1b7d03611c2878b8652cfcd794ab /qutebrowser/browser
parent779fcb13ec7fd90ff8422640e40babe87de97c99 (diff)
downloadqutebrowser-5a522e9c978c1d4ed7d21256dd36c98b3ef730af.tar.gz
qutebrowser-5a522e9c978c1d4ed7d21256dd36c98b3ef730af.zip
Avoid running migrations partially
Diffstat (limited to 'qutebrowser/browser')
-rw-r--r--qutebrowser/browser/history.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py
index a1db97f61..779737987 100644
--- a/qutebrowser/browser/history.py
+++ b/qutebrowser/browser/history.py
@@ -188,16 +188,17 @@ class WebHistory(sql.SqlTable):
rebuild_completion = self.metainfo['force_rebuild']
if self._database.user_version_changed():
- # If the DB user version changed, run a full cleanup and rebuild the
- # completion history.
- #
- # In the future, this could be improved to only be done when actually needed
- # - but version changes happen very infrequently, rebuilding everything
- # gives us less corner-cases to deal with, and we can run a VACUUM to make
- # things smaller.
- self._cleanup_history()
- rebuild_completion = True
- self._database.upgrade_user_version()
+ with self._database.transaction():
+ # If the DB user version changed, run a full cleanup and rebuild the
+ # completion history.
+ #
+ # In the future, this could be improved to only be done when actually
+ # needed - but version changes happen very infrequently, rebuilding
+ # everything gives us less corner-cases to deal with, and we can run a
+ # VACUUM to make things smaller.
+ self._cleanup_history()
+ rebuild_completion = True
+ self._database.upgrade_user_version()
# Get a string of all patterns
patterns = config.instance.get_str('completion.web_history.exclude')