BE: handle missing buildtimestamp.txt

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2025-10-31 08:12:38 +11:00
parent 512dedff4e
commit 63d6410bb4
2 changed files with 18 additions and 3 deletions

View File

@@ -773,8 +773,16 @@ def checkNewVersion():
newVersion = False
with open(applicationPath + '/front/buildtimestamp.txt', 'r') as f:
buildTimestamp = int(f.read().strip())
build_timestamp_path = os.path.join(applicationPath, 'front/buildtimestamp.txt')
# Ensure file exists, initialize if missing
if not os.path.exists(build_timestamp_path):
with open(build_timestamp_path, 'w') as f:
f.write("0")
# Now safely read the timestamp
with open(build_timestamp_path, 'r') as f:
buildTimestamp = int(f.read().strip() or 0)
try:
response = requests.get(