projects
/
quix0rs-apt-p2p.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
19dab12
)
Don't create a thread to load the packages cache if it's already loaded.
author
Cameron Dale
<camrdale@gmail.com>
Thu, 17 Apr 2008 18:56:15 +0000
(11:56 -0700)
committer
Cameron Dale
<camrdale@gmail.com>
Thu, 17 Apr 2008 18:56:15 +0000
(11:56 -0700)
apt_p2p/AptPackages.py
patch
|
blob
|
history
diff --git
a/apt_p2p/AptPackages.py
b/apt_p2p/AptPackages.py
index ef2a1f327c90429b3d1d9d11f6f0e51e9b4e42e0..4b6abe75ac3a917723451623846c0c4f4f14c217 100644
(file)
--- 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)
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')
# Make sure it's not already being loaded
if self.loading is None:
log.msg('Loading the packages cache')