Skip to content

Commit

Permalink
Fix LRU cache error
Browse files Browse the repository at this point in the history
  • Loading branch information
hwiorn committed Nov 29, 2022
1 parent fa36baa commit bd96e56
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ def wrapper(*args):
if cache_missed:
# print('cache miss!')
org_name, docs = func(*args)
mtime = os.path.getmtime(org_name)
size = os.path.getsize(org_name)
func.cache[args] = (org_name, docs, size, mtime)
if org_name:
mtime = os.path.getmtime(org_name)
size = os.path.getsize(org_name)
func.cache[args] = (org_name, docs, size, mtime)
return org_name, docs

return wrapper
Expand Down

0 comments on commit bd96e56

Please sign in to comment.