]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
Sync the AptPackages db after modification, and close when done.
authorCameron Dale <camrdale@gmail.com>
Mon, 21 Apr 2008 02:47:31 +0000 (19:47 -0700)
committerCameron Dale <camrdale@gmail.com>
Mon, 21 Apr 2008 02:47:31 +0000 (19:47 -0700)
apt_p2p/AptPackages.py
apt_p2p/apt_p2p.py

index 4b6abe75ac3a917723451623846c0c4f4f14c217..69f1928803643fe779f930283f0ac5658fed6885 100644 (file)
@@ -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]
index 41f32d36c2bff611570248a09c7713916e84773c..dfeb3e7b5ef67c05ef9ab3a236acf3e8bd641938 100644 (file)
@@ -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()