diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-05-05 21:05:11 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-05-05 21:07:45 +0200 |
commit | 09b025b689a6000963cde0c40f7c9e67b7d58280 (patch) | |
tree | 870ebf81ff7a633d7f595d4f504f7b59cad28f5a | |
parent | 8927f5c9355ce0b819161474869e15a87279d2b0 (diff) | |
download | wee-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.py | 2 |
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)) |