|
@@ -12,7 +12,6 @@ import aiohttp
|
|
|
import requests
|
|
|
from open_webui.apps.webui.models.models import Models
|
|
|
from open_webui.config import (
|
|
|
- AIOHTTP_CLIENT_TIMEOUT,
|
|
|
CORS_ALLOW_ORIGIN,
|
|
|
ENABLE_MODEL_FILTER,
|
|
|
ENABLE_OLLAMA_API,
|
|
@@ -21,6 +20,9 @@ from open_webui.config import (
|
|
|
UPLOAD_DIR,
|
|
|
AppConfig,
|
|
|
)
|
|
|
+from open_webui.env import AIOHTTP_CLIENT_TIMEOUT
|
|
|
+
|
|
|
+
|
|
|
from open_webui.constants import ERROR_MESSAGES
|
|
|
from open_webui.env import SRC_LOG_LEVELS
|
|
|
from fastapi import Depends, FastAPI, File, HTTPException, Request, UploadFile
|
|
@@ -117,7 +119,7 @@ async def update_ollama_api_url(form_data: UrlUpdateForm, user=Depends(get_admin
|
|
|
|
|
|
|
|
|
async def fetch_url(url):
|
|
|
- timeout = aiohttp.ClientTimeout(total=5)
|
|
|
+ timeout = aiohttp.ClientTimeout(total=3)
|
|
|
try:
|
|
|
async with aiohttp.ClientSession(timeout=timeout, trust_env=True) as session:
|
|
|
async with session.get(url) as response:
|