From c5cc5788c6800526472a68cdd7444a6f4253b74b Mon Sep 17 00:00:00 2001 From: Cameron Dale Date: Thu, 17 Apr 2008 11:56:15 -0700 Subject: [PATCH] Don't create a thread to load the packages cache if it's already loaded. --- apt_p2p/AptPackages.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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') -- 2.39.5