From 448a409c030cc2aaf99cc686e76d62b5739e5df8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 20 Dec 2006 22:09:59 +0000 Subject: [PATCH] More intelligently handle CacheCorruption errors in the writable cache. svn path=/main/trunk/; revision=5338 --- pym/cache/metadata_overlay.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pym/cache/metadata_overlay.py b/pym/cache/metadata_overlay.py index 9320b0938..c4d18c173 100644 --- a/pym/cache/metadata_overlay.py +++ b/pym/cache/metadata_overlay.py @@ -6,6 +6,7 @@ import time if not hasattr(__builtins__, "set"): from sets import Set as set from cache import template +from cache.cache_errors import CacheCorruption from cache.flat_hash import database as db_rw from cache.metadata import database as db_ro @@ -26,6 +27,9 @@ class database(template.database): value = self.db_rw[cpv] except KeyError: return self.db_ro[cpv] # raises a KeyError when necessary + except CacheCorruption: + del self.db_rw[cpv] + return self.db_ro[cpv] # raises a KeyError when necessary if self._is_whiteout(value): if self._is_whiteout_valid(cpv, value): raise KeyError(cpv) -- 2.26.2