put a 20 second timeout on wait_for calls

This commit is contained in:
jesopo 2020-06-15 11:13:52 +01:00
parent 11873094aa
commit 75c12d83e8

View file

@ -27,6 +27,7 @@ from .interface import ITCPTransport, ITCPReader, ITCPWriter
THROTTLE_RATE = 4 # lines
THROTTLE_TIME = 2 # seconds
PING_TIMEOUT = 60 # seconds
WAIT_TIMEOUT = 20 # seconds
JOIN_ERR_FIRST = [
ERR_NOSUCHCHANNEL,
@ -287,6 +288,7 @@ class Server(IServer):
label = str(sent_line.id)
our_wait_for.with_label(label)
async with timeout(WAIT_TIMEOUT):
return (await our_wait_for)
async def _on_send_line(self, line: Line):