Fix VERSION comparison and add debug values to check endpoint
This commit is contained in:
1 parent
55f87f8fbb
commit
51252b7f98
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -737,6 +737,6 @@ def register_api_routes(app, services, settings):
|
||||
return jsonify({
|
||||
'available': updater.update_available,
|
||||
'status': updater.update_status,
|
||||
'local_sha': updater._current_sha,
|
||||
'remote_sha': updater._latest_sha,
|
||||
'local_version': updater._current_sha,
|
||||
'remote_version': updater._latest_sha,
|
||||
})
|
||||
@@ -71,13 +71,13 @@ class UpdateService:
|
||||
version_file = os.path.join(self.project_root, 'VERSION')
|
||||
if os.path.exists(version_file):
|
||||
with open(version_file) as f:
|
||||
local_version = f.read().strip()
|
||||
local_version = f.read().strip().replace('\r', '').replace('\n', '')
|
||||
else:
|
||||
local_version = "unknown"
|
||||
|
||||
self._latest_sha = remote_version
|
||||
self._current_sha = local_version
|
||||
self._update_available = remote_version != local_version
|
||||
self._update_available = remote_version != local_version and remote_version != ""
|
||||
self._last_check = time.time()
|
||||
logger.info(f"Update check: {'available' if self._update_available else 'up to date'} (local={local_version}, remote={remote_version})")
|
||||
except Exception as e:
|
||||
|
||||
Reference in new issue
Block a user