aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-09-09 11:19:57 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2020-09-09 11:20:13 +0200
commita7b9e7d80b51ba6c0270624087520e88ec861ecd (patch)
treed35768719a9515bd076c48fd591e6f994c49975a
parentfc2bcba111bdc40a001f9ec481c6dc6143da990c (diff)
downloadwee-slack-a7b9e7d80b51ba6c0270624087520e88ec861ecd.tar.gz
Use slack_timeout for websocket connection
Relates to #793
-rw-r--r--wee_slack.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index c941a7c..eb69b3f 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1464,10 +1464,11 @@ class SlackTeam(object):
try:
# only http proxy is currently supported
proxy = ProxyWrapper()
+ timeout = config.slack_timeout / 1000
if proxy.has_proxy == True:
- ws = create_connection(self.ws_url, sslopt=sslopt_ca_certs, http_proxy_host=proxy.proxy_address, http_proxy_port=proxy.proxy_port, http_proxy_auth=(proxy.proxy_user, proxy.proxy_password))
+ ws = create_connection(self.ws_url, timeout=timeout, sslopt=sslopt_ca_certs, http_proxy_host=proxy.proxy_address, http_proxy_port=proxy.proxy_port, http_proxy_auth=(proxy.proxy_user, proxy.proxy_password))
else:
- ws = create_connection(self.ws_url, sslopt=sslopt_ca_certs)
+ ws = create_connection(self.ws_url, timeout=timeout, sslopt=sslopt_ca_certs)
self.hook = w.hook_fd(ws.sock.fileno(), 1, 0, 0, "receive_ws_callback", self.get_team_hash())
ws.sock.setblocking(0)