aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevan Franchini <twitch153@gentoo.org>2017-02-01 20:11:01 -0500
committerDevan Franchini <twitch153@gentoo.org>2017-02-01 20:11:03 -0500
commitd9112d003d5d9bcc71d681206522cc161f59f169 (patch)
treeafbd859b08b03fea69cdda4f21b5c5fc3993d79e
parentargparser.py: Fixed typo in --help output (diff)
downloadlayman-d9112d003d5d9bcc71d681206522cc161f59f169.tar.gz
layman-d9112d003d5d9bcc71d681206522cc161f59f169.tar.bz2
layman-d9112d003d5d9bcc71d681206522cc161f59f169.zip
api.py: Moves instantiation of rdb to above for-loop
There is no need to repeatedly connect to the rdb when syncing overlays. We are better off connecting once and querying it whenever we need to. Doing it every time leads us to issues like bug #603296 X-Gentoo-Bug: 603296 X-Gentoo-Bug-URL: https://bugs.gentoo.org/603296
-rwxr-xr-xlayman/api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/layman/api.py b/layman/api.py
index 2c46bb7..73fb72a 100755
--- a/layman/api.py
+++ b/layman/api.py
@@ -384,6 +384,7 @@ class LaymanAPI(object):
success = []
repos = self._check_repo_type(repos, "sync")
db = self._get_installed_db()
+ rdb = self._get_remote_db()
self.output.debug("API.sync(); starting ovl loop", 5)
for ovl in repos:
@@ -406,7 +407,7 @@ class LaymanAPI(object):
try:
self.output.debug("API.sync(); try: self._get_remote_db().select(ovl)", 5)
- ordb = self._get_remote_db().select(ovl)
+ ordb = rdb.select(ovl)
except UnknownOverlayException:
message = 'Overlay "%(repo)s" could not be found in the remote '\
'lists.\nPlease check if it has been renamed and '\