X-Git-Url: https://git.mxchange.org/?p=quix0rs-apt-p2p.git;a=blobdiff_plain;f=apt_dht%2FMirrorManager.py;h=bccb2e53ff4bd3bec7fd6f83415163eb2308c13d;hp=79f577ba6d8dc3e4cf8dbcafb5b978245c09b84b;hb=b36fa9c7f5ad4827c8de990fbfca1a379bb60e39;hpb=5ae15cb5cc24c1fd9a75ea7a8b416f733d1c79be diff --git a/apt_dht/MirrorManager.py b/apt_dht/MirrorManager.py index 79f577b..bccb2e5 100644 --- a/apt_dht/MirrorManager.py +++ b/apt_dht/MirrorManager.py @@ -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