Allow 10 second for reponse

This commit is contained in:
shortcutme 2017-10-03 14:34:21 +02:00
parent 2cf86642a2
commit 52a468d9fd
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -200,17 +200,17 @@ class ConnectionServer:
# Incomplete data with more than 10 sec idle
connection.close("[Cleanup] Connection buff stalled")
elif idle > 10 and connection.waiting_requests and time.time() - connection.last_send_time > 20:
elif idle > 10 and connection.protocol == "?": # No connection after 10 sec
connection.close(
"[Cleanup] Connect timeout: %.3fs" % idle
)
elif idle > 10 and connection.waiting_requests and time.time() - connection.last_send_time > 10:
# Sent command and no response in 10 sec
connection.close(
"[Cleanup] Command %s timeout: %.3fs" % (connection.last_cmd, time.time() - connection.last_send_time)
)
elif idle > 30 and connection.protocol == "?": # No connection after 30 sec
connection.close(
"[Cleanup] Connect timeout: %.3fs" % idle
)
elif idle < 60 and connection.bad_actions > 40:
connection.close(
"[Cleanup] Too many bad actions: %s" % connection.bad_actions