From: Cameron Dale Date: Mon, 21 Apr 2008 02:47:31 +0000 (-0700) Subject: Sync the AptPackages db after modification, and close when done. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ef79e4cb347b1fbd7df95dcd717cfb7e3121ae9d;p=quix0rs-apt-p2p.git Sync the AptPackages db after modification, and close when done. --- 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()