Merge branch 'documentation' into apt-dht
[quix0rs-apt-p2p.git] / apt_dht / MirrorManager.py
index 79f577b..bccb2e5 100644 (file)
@@ -118,6 +118,13 @@ class MirrorManager:
         d.errback(MirrorError("Site Not Found"))
         return d
     
+    def cleanup(self):
+        for site in self.apt_caches.keys():
+            for baseDir in self.apt_caches[site].keys():
+                self.apt_caches[site][baseDir].cleanup()
+                del self.apt_caches[site][baseDir]
+            del self.apt_caches[site]
+    
 class TestMirrorManager(unittest.TestCase):
     """Unit tests for the mirror manager."""
     
@@ -233,5 +240,6 @@ class TestMirrorManager(unittest.TestCase):
         for p in self.pending_calls:
             if p.active():
                 p.cancel()
+        self.client.cleanup()
         self.client = None
         
\ No newline at end of file