[+] NOCACHE option
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import json
|
import json
|
||||||
import hashlib
|
import hashlib
|
||||||
import tomllib
|
import tomllib
|
||||||
@@ -27,7 +28,7 @@ def _disk_cache_decorator(subdir_name: str, ext: str, read_func, write_func, sho
|
|||||||
|
|
||||||
cache_p = Path(__file__).parent / 'data' / subdir_name / f"{key}{ext}"
|
cache_p = Path(__file__).parent / 'data' / subdir_name / f"{key}{ext}"
|
||||||
|
|
||||||
if cache_p.is_file():
|
if cache_p.is_file() and not os.getenv("NOCACHE"):
|
||||||
try:
|
try:
|
||||||
return read_func(cache_p)
|
return read_func(cache_p)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user