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

This commit is contained in:
Sergey Krashevich 2023-06-15 01:19:26 +03:00 committed by GitHub
parent ff1b5c87aa
commit 3efa77f302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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