Skip to content

Commit

Permalink
Removed what appears to be dead code since we dont use threads
Browse files Browse the repository at this point in the history
  • Loading branch information
euri10 committed Dec 27, 2020
1 parent 20bce10 commit eb45afc
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions uvicorn/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import signal
import socket
import sys
import threading
import time
from email.utils import formatdate

Expand Down Expand Up @@ -240,12 +239,7 @@ async def shutdown(self, sockets=None):
await self.lifespan.shutdown()

def install_signal_handlers(self) -> None:
if threading.current_thread() is not threading.main_thread():
# Signals can only be listened to from the main thread.
return

loop = asyncio.get_event_loop()

try:
for sig in HANDLED_SIGNALS:
loop.add_signal_handler(sig, self.handle_exit, sig, None)
Expand Down

0 comments on commit eb45afc

Please sign in to comment.