ignore cache if not able to load json file
This commit is contained in:
parent
e2936705c4
commit
4ae8783d27
1 changed files with 4 additions and 2 deletions
|
@ -264,8 +264,10 @@ class FileCache(Cache):
|
||||||
prefix, i, f = self.files(domain, url_hash)
|
prefix, i, f = self.files(domain, url_hash)
|
||||||
if os.path.exists(i):
|
if os.path.exists(i):
|
||||||
with open(i) as _i:
|
with open(i) as _i:
|
||||||
info = json.load(_i)
|
try:
|
||||||
|
info = json.load(_i)
|
||||||
|
except:
|
||||||
|
return r
|
||||||
now = time.mktime(time.localtime())
|
now = time.mktime(time.localtime())
|
||||||
expired = now-timeout
|
expired = now-timeout
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue