mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
fix: prevent duplicate MCP reload scheduler registration
This commit is contained in:
parent
c171954629
commit
73f66b101c
1 changed files with 0 additions and 28 deletions
|
|
@ -4120,23 +4120,6 @@ class ProxyConfig:
|
|||
return []
|
||||
|
||||
|
||||
async def _reload_mcp_servers_job():
|
||||
"""Background job entrypoint for MCP registry refreshes."""
|
||||
if proxy_config._should_load_db_object(object_type="mcp") is False:
|
||||
return
|
||||
|
||||
try:
|
||||
from litellm.proxy._experimental.mcp_server.mcp_server_manager import (
|
||||
global_mcp_server_manager,
|
||||
)
|
||||
|
||||
await global_mcp_server_manager.reload_servers_from_database()
|
||||
except Exception as e:
|
||||
verbose_proxy_logger.exception(
|
||||
"Failed to reload MCP servers from database: %s", str(e)
|
||||
)
|
||||
|
||||
|
||||
proxy_config = ProxyConfig()
|
||||
|
||||
|
||||
|
|
@ -4675,17 +4658,6 @@ class ProxyStartupEvent:
|
|||
)
|
||||
await proxy_config.get_credentials(prisma_client=prisma_client)
|
||||
|
||||
from litellm.proxy._experimental.mcp_server.utils import is_mcp_available
|
||||
|
||||
if is_mcp_available():
|
||||
scheduler.add_job(
|
||||
_reload_mcp_servers_job,
|
||||
"interval",
|
||||
seconds=30,
|
||||
id="reload_mcp_servers_job",
|
||||
replace_existing=True,
|
||||
misfire_grace_time=APSCHEDULER_MISFIRE_GRACE_TIME,
|
||||
)
|
||||
await cls._initialize_slack_alerting_jobs(
|
||||
scheduler=scheduler,
|
||||
general_settings=general_settings,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue