Delete empty cache files
When a cache filler function returns without success, we need to delete the empty file we create so that it doesn't trigger a false positive the next time we access it.
This commit is contained in:
parent
ba90106588
commit
4f899c4834
|
@ -7,6 +7,7 @@ mkdir = path.mkdir
|
|||
exists = path.exists
|
||||
join = path.join
|
||||
ls = path.ls
|
||||
rm = path.rm
|
||||
|
||||
CACHE_DIR = expand("~/.saria/cache")
|
||||
mkdir(CACHE_DIR)
|
||||
|
@ -26,6 +27,9 @@ class CacheObject:
|
|||
pass
|
||||
if success:
|
||||
return path
|
||||
else:
|
||||
rm(path)
|
||||
|
||||
else:
|
||||
return path
|
||||
|
||||
|
|
Loading…
Reference in New Issue