Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
cbb21a14
Commit
cbb21a14
authored
Apr 09, 2024
by
Timothy J. Baek
Browse files
fix: async version check
parent
2f6e6831
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
backend/main.py
backend/main.py
+12
-8
No files found.
backend/main.py
View file @
cbb21a14
...
...
@@ -5,6 +5,7 @@ import time
import
os
import
sys
import
logging
import
aiohttp
import
requests
from
fastapi
import
FastAPI
,
Request
,
Depends
,
status
...
...
@@ -18,6 +19,7 @@ from starlette.middleware.base import BaseHTTPMiddleware
from
apps.ollama.main
import
app
as
ollama_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.audio.main
import
app
as
audio_app
from
apps.images.main
import
app
as
images_app
...
...
@@ -271,14 +273,16 @@ async def get_app_changelog():
@
app
.
get
(
"/api/version/updates"
)
async
def
get_app_latest_release_version
():
try
:
response
=
requests
.
get
(
f
"https://api.github.com/repos/open-webui/open-webui/releases/latest"
)
async
with
aiohttp
.
ClientSession
()
as
session
:
async
with
session
.
get
(
"https://api.github.com/repos/open-webui/open-webui/releases/latest"
)
as
response
:
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
:]}
except
Exception
as
e
:
except
aiohttp
.
ClientError
as
e
:
raise
HTTPException
(
status_code
=
status
.
HTTP_503_SERVICE_UNAVAILABLE
,
detail
=
ERROR_MESSAGES
.
RATE_LIMIT_EXCEEDED
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment