Jeremiah Lowin commited on
Commit
c976454
·
1 Parent(s): 82e9a76

Update server.py

Browse files
Files changed (1) hide show
  1. src/fastmcp/server/server.py +2 -0
src/fastmcp/server/server.py CHANGED
@@ -830,6 +830,8 @@ class FastMCP(Generic[LifespanResultT]):
830
  ) -> None:
831
  """Run the server using SSE transport."""
832
  uvicorn_config = uvicorn_config or {}
 
 
833
  uvicorn_config.setdefault("timeout_graceful_shutdown", 0)
834
  app = RequestMiddleware(self.sse_app())
835
 
 
830
  ) -> None:
831
  """Run the server using SSE transport."""
832
  uvicorn_config = uvicorn_config or {}
833
+ # the SSE app hangs even when a signal is sent, so we disable the timeout to make it possible to close immediately.
834
+ # see https://github.com/jlowin/fastmcp/issues/296
835
  uvicorn_config.setdefault("timeout_graceful_shutdown", 0)
836
  app = RequestMiddleware(self.sse_app())
837