From ef79e4cb347b1fbd7df95dcd717cfb7e3121ae9d Mon Sep 17 00:00:00 2001 From: Cameron Dale Date: Sun, 20 Apr 2008 19:47:31 -0700 Subject: [PATCH] Sync the AptPackages db after modification, and close when done. --- apt_p2p/AptPackages.py | 2 ++ apt_p2p/apt_p2p.py | 1 + 2 files changed, 3 insertions(+) diff --git a/apt_p2p/AptPackages.py b/apt_p2p/AptPackages.py index 4b6abe7..69f1928 100644 --- a/apt_p2p/AptPackages.py +++ b/apt_p2p/AptPackages.py @@ -92,6 +92,7 @@ class PackageFileList(DictMixin): if filename.lower() in TRACKED_FILES: log.msg("Registering package file: "+cache_path) self.packages[cache_path] = file_path + self.packages.sync() return True return False @@ -103,6 +104,7 @@ class PackageFileList(DictMixin): if not self.packages[f].exists(): log.msg("File in packages database has been deleted: "+f) del self.packages[f] + self.packages.sync() #{ Dictionary interface details def __getitem__(self, key): return self.packages[key] diff --git a/apt_p2p/apt_p2p.py b/apt_p2p/apt_p2p.py index 41f32d3..dfeb3e7 100644 --- a/apt_p2p/apt_p2p.py +++ b/apt_p2p/apt_p2p.py @@ -102,6 +102,7 @@ class AptP2P(protocol.Factory): def stopFactory(self): log.msg('Stoppping the main apt_p2p application') self.http_server.getHTTPFactory().stopFactory() + self.mirrors.cleanup() self.stats.save() self.db.close() -- 2.39.5