mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
feat: check for updates
This commit is contained in:
@@ -47,3 +47,4 @@ class ERROR_MESSAGES(str, Enum):
|
||||
INCORRECT_FORMAT = (
|
||||
lambda err="": f"Invalid format. Please use the correct format{err if err else ''}"
|
||||
)
|
||||
RATE_LIMIT_EXCEEDED = "API rate limit exceeded"
|
||||
|
||||
@@ -139,15 +139,11 @@ async def get_app_latest_release_version():
|
||||
response.raise_for_status()
|
||||
latest_version = response.json()["tag_name"]
|
||||
|
||||
# Compare versions
|
||||
return {
|
||||
"current": VERSION,
|
||||
"latest": latest_version[1:],
|
||||
}
|
||||
return {"current": VERSION, "latest": latest_version[1:]}
|
||||
except Exception as e:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
|
||||
detail=ERROR_MESSAGES.NOT_FOUND,
|
||||
detail=ERROR_MESSAGES.RATE_LIMIT_EXCEEDED,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user