Round the timestamp value read from .vacuum file to prevent potential errors caused by float values

This commit is contained in:
Sergey Krashevich 2023-06-14 20:25:34 +03:00
parent ff1b5c87aa
commit 5a25138a71
No known key found for this signature in database
GPG Key ID: 625171324E7D3856

View File

@ -196,7 +196,7 @@ class FrigateApp:
if os.path.exists(f"{CONFIG_DIR}/.vacuum"): if os.path.exists(f"{CONFIG_DIR}/.vacuum"):
with open(f"{CONFIG_DIR}/.vacuum") as f: with open(f"{CONFIG_DIR}/.vacuum") as f:
try: try:
timestamp = int(f.readline()) timestamp = round(float(f.readline()))
except Exception: except Exception:
timestamp = 0 timestamp = 0