Skip to content

Commit

Permalink
Fix sockets iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
FrsECM authored and Borda committed Feb 11, 2025
1 parent 1ef2707 commit dae6f5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/litserve/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,8 @@ def _start_server(self, port, num_uvicorn_servers, log_level, sockets, uvicorn_w
logger.debug("Enable Windows explicit socket sharing...")
# We make sure sockets is listening...
# It prevents further [WinError 10022]
[sock.listen(config.backlog) for sock in sockets]
for sock in sockets:
sock.listen(config.backlog)
# We add worker to say unicorn to use a shared socket (win32)
# https://github.com/encode/uvicorn/pull/802
config.workers = num_uvicorn_servers
Expand Down

0 comments on commit dae6f5c

Please sign in to comment.