"src/include/ConstantMergedTensorDescriptor.hpp" did not exist on "0a2657312ec62a65e92a36cebd7d3b2a3c0712e1"
Commit cbb21a14 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: async version check

parent 2f6e6831
...@@ -5,6 +5,7 @@ import time ...@@ -5,6 +5,7 @@ import time
import os import os
import sys import sys
import logging import logging
import aiohttp
import requests import requests
from fastapi import FastAPI, Request, Depends, status from fastapi import FastAPI, Request, Depends, status
...@@ -18,6 +19,7 @@ from starlette.middleware.base import BaseHTTPMiddleware ...@@ -18,6 +19,7 @@ from starlette.middleware.base import BaseHTTPMiddleware
from apps.ollama.main import app as ollama_app from apps.ollama.main import app as ollama_app
from apps.openai.main import app as openai_app from apps.openai.main import app as openai_app
from apps.litellm.main import app as litellm_app, startup as litellm_app_startup from apps.litellm.main import app as litellm_app, startup as litellm_app_startup
from apps.audio.main import app as audio_app from apps.audio.main import app as audio_app
from apps.images.main import app as images_app from apps.images.main import app as images_app
...@@ -271,14 +273,16 @@ async def get_app_changelog(): ...@@ -271,14 +273,16 @@ async def get_app_changelog():
@app.get("/api/version/updates") @app.get("/api/version/updates")
async def get_app_latest_release_version(): async def get_app_latest_release_version():
try: try:
response = requests.get( async with aiohttp.ClientSession() as session:
f"https://api.github.com/repos/open-webui/open-webui/releases/latest" async with session.get(
) "https://api.github.com/repos/open-webui/open-webui/releases/latest"
) as response:
response.raise_for_status() response.raise_for_status()
latest_version = response.json()["tag_name"] data = await response.json()
latest_version = data["tag_name"]
return {"current": VERSION, "latest": latest_version[1:]} return {"current": VERSION, "latest": latest_version[1:]}
except Exception as e: except aiohttp.ClientError as e:
raise HTTPException( raise HTTPException(
status_code=status.HTTP_503_SERVICE_UNAVAILABLE, status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
detail=ERROR_MESSAGES.RATE_LIMIT_EXCEEDED, detail=ERROR_MESSAGES.RATE_LIMIT_EXCEEDED,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment