generated from nathanwoodburn/python-webserver-template
feat: Add more descriptive cache error message
All checks were successful
Build Docker / BuildImage (push) Successful in 35s
All checks were successful
Build Docker / BuildImage (push) Successful in 35s
This commit is contained in:
parent
10d2cfcca8
commit
721025b10c
2
cache.py
2
cache.py
@ -33,7 +33,7 @@ def file_cache(ttl=3600):
|
|||||||
with open(cache_file, "w") as f:
|
with open(cache_file, "w") as f:
|
||||||
json.dump({"timestamp": time(), "result": result}, f)
|
json.dump({"timestamp": time(), "result": result}, f)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error during cache refresh: {e}",flush=True)
|
print(f"Error during cache refresh of {cache_file} (Name: {func.__name__}): {e}")
|
||||||
|
|
||||||
threading.Thread(target=refresh_loop).start()
|
threading.Thread(target=refresh_loop).start()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user