Don’t raise error when cache item has been deleted from another thread

This commit is contained in:
Ivan Kravets
2017-05-01 01:33:51 +03:00
parent 884859324d
commit 56d4d545c1

View File

@ -155,9 +155,12 @@ class ContentCache(object):
continue continue
found = True found = True
if isfile(path): if isfile(path):
remove(path) try:
if not listdir(dirname(path)): remove(path)
util.rmtree_(dirname(path)) if not listdir(dirname(path)):
util.rmtree_(dirname(path))
except OSError:
pass
if found and self._lock_dbindex(): if found and self._lock_dbindex():
with open(self._db_path, "w") as fp: with open(self._db_path, "w") as fp: