forked from open-webui/open-webui
feat: check for updates
This commit is contained in:
parent
6bfe2a6306
commit
759883a4c8
8 changed files with 91 additions and 14 deletions
|
@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue