aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2019-05-05 21:05:11 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2019-05-05 21:07:45 +0200
commit09b025b689a6000963cde0c40f7c9e67b7d58280 (patch)
tree870ebf81ff7a633d7f595d4f504f7b59cad28f5a
parent8927f5c9355ce0b819161474869e15a87279d2b0 (diff)
downloadwee-slack-09b025b689a6000963cde0c40f7c9e67b7d58280.tar.gz
Increase pong timeout to 30 seconds
Even after the last two changes, I have still experienced a disconnect because of missing pong once where I think I possibly shouldn't have been disconnected. Hopefully 30 seconds is a good compromise between not disconnecting when it isn't necessary and not waiting too long before disconnecting a dead connection.
-rw-r--r--wee_slack.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 6482283..2751eb2 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -403,7 +403,7 @@ class EventRouter(object):
for team in self.teams.values():
time_since_last_ping = time.time() - team.last_ping_time
time_since_last_pong = time.time() - team.last_pong_time
- if team.connected and time_since_last_ping < 5 and time_since_last_pong > 12:
+ if team.connected and time_since_last_ping < 5 and time_since_last_pong > 30:
w.prnt(team.channel_buffer,
'Lost connection to slack team {} (no pong), reconnecting.'.format(
team.domain))