Merge branch 'documentation' into apt-dht
[quix0rs-apt-p2p.git] / apt_dht / MirrorManager.py
index 79f577ba6d8dc3e4cf8dbcafb5b978245c09b84b..bccb2e53ff4bd3bec7fd6f83415163eb2308c13d 100644 (file)
@@ -118,6 +118,13 @@ class MirrorManager:
         d.errback(MirrorError("Site Not Found"))
         return d
     
         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."""
     
 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()
         for p in self.pending_calls:
             if p.active():
                 p.cancel()
+        self.client.cleanup()
         self.client = None
         
\ No newline at end of file
         self.client = None
         
\ No newline at end of file