summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Norwood <rnorwood@redhat.com>2008-04-15 14:34:57 -0400
committerRichard Hughes <richard@hughsie.com>2008-04-15 20:08:51 +0100
commitfb3d380d4725f50e6d040c6eba43d3f1d66aa0ae (patch)
treea4fd6f510f4f331eaaf3a63b402451c623dfe754
parenta7f965716cf5edde5e80b0fbb47074f92f862d03 (diff)
Set default throttle to 90%
-rw-r--r--backends/yum/helpers/yumBackend.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index c3301b1da..598ab387b 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -777,12 +777,18 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self.percentage(0)
self.status(STATUS_RUNNING)
+ old_throttle = self.yumbase.conf.throttle
+ self.yumbase.conf.throttle = "60%" # Set bandwidth throttle to 60%
+ # to avoid taking all the system's bandwidth.
+
txmbr = self.yumbase.update() # Add all updates to Transaction
if txmbr:
self._runYumTransaction()
else:
self.error(ERROR_INTERNAL_ERROR,"Nothing to do")
+ self.yumbase.conf.throttle = old_throttle
+
def refresh_cache(self):
'''
Implement the {backend}-refresh_cache functionality
@@ -1352,7 +1358,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
def _setup_yum(self):
self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0) # Setup Yum Config
- self.yumbase.conf.throttle = "40%" # Set bandwidth throttle to 40%
+ self.yumbase.conf.throttle = "90%" # Set bandwidth throttle to 40%
self.dnlCallback = DownloadCallback(self,showNames=True) # Download callback
self.yumbase.repos.setProgressBar( self.dnlCallback ) # Setup the download callback class