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 4b6abe7..69f1928 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 41f32d3..dfeb3e7 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()