This commit is contained in:
Timothy Jaeryang Baek 2025-04-30 16:01:23 +04:00
parent e822984162
commit eb68b21e0f
2 changed files with 7 additions and 7 deletions

View File

@ -383,7 +383,7 @@ from open_webui.utils.auth import (
get_admin_user,
get_verified_user,
)
from open_webui.utils.plugin import install_admin_tool_and_function_dependencies
from open_webui.utils.plugin import install_tool_and_function_dependencies
from open_webui.utils.oauth import OAuthManager
from open_webui.utils.security_headers import SecurityHeadersMiddleware
@ -446,6 +446,11 @@ async def lifespan(app: FastAPI):
if LICENSE_KEY:
get_license_data(app, LICENSE_KEY)
# This should be blocking (sync) so functions are not deactivated on first /get_models calls
# when the first user lands on the / route.
log.info("Installing external dependencies of functions and tools...")
install_tool_and_function_dependencies()
pool_size = THREAD_POOL_SIZE
if pool_size and pool_size > 0:
limiter = anyio.to_thread.current_default_thread_limiter()
@ -453,11 +458,6 @@ async def lifespan(app: FastAPI):
asyncio.create_task(periodic_usage_pool_cleanup())
# This should be blocking (sync) so functions are not deactivated on first /get_models calls
# when the first user lands on the / route.
log.info("Installing external dependencies of functions and tools...")
install_admin_tool_and_function_dependencies()
yield

View File

@ -185,7 +185,7 @@ def install_frontmatter_requirements(requirements: str):
log.info("No requirements found in frontmatter.")
def install_admin_tool_and_function_dependencies():
def install_tool_and_function_dependencies():
"""
Install all dependencies for all admin tools and active functions.