Skip to content

Commit cd78ab4

Browse files
authored
Fix #1462 websocket_client-based SocketModeClient does not reconnect after a DNS outage (#1466)
1 parent fe45e0b commit cd78ab4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

slack_sdk/socket_mode/websocket_client/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ def _run_current_session(self):
244244
self.logger.info("Stopped receiving messages from a connection")
245245
except Exception as e:
246246
self.logger.exception(f"Failed to start or stop the current session: {e}")
247+
# To let the monitoring job detect the connection issue, closing this session
248+
if self.current_session is not None:
249+
self.current_session.close()
247250

248251
def _monitor_current_session(self):
249252
if self.current_app_monitor_started:

0 commit comments

Comments
 (0)