From: Cameron Dale Date: Thu, 17 Apr 2008 18:56:15 +0000 (-0700) Subject: Don't create a thread to load the packages cache if it's already loaded. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c5cc5788c6800526472a68cdd7444a6f4253b74b;p=quix0rs-apt-p2p.git Don't create a thread to load the packages cache if it's already loaded. --- diff --git a/apt_p2p/AptPackages.py b/apt_p2p/AptPackages.py index ef2a1f3..4b6abe7 100644 --- a/apt_p2p/AptPackages.py +++ b/apt_p2p/AptPackages.py @@ -243,7 +243,11 @@ class AptPackages: self.unload_later.reset(config.gettime('DEFAULT', 'UNLOAD_PACKAGES_CACHE')) else: self.unload_later = reactor.callLater(config.gettime('DEFAULT', 'UNLOAD_PACKAGES_CACHE'), self.unload) - + + # Check if it's already loaded + if self.loaded: + return defer.succeed(True) + # Make sure it's not already being loaded if self.loading is None: log.msg('Loading the packages cache')