Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSS retry #21

Open
valentin2105 opened this Issue Apr 9, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@valentin2105
Copy link

commented Apr 9, 2019

Hi,

I'm using a part of this bot sample in an internal bot we use and I face an issue,

after few delay, the wss notification stop to be received to the bot.

I think it's located on this part of the code base :

 49         webSocketClient.Listen()                                                                                   
 50         go func() {                                                                                                
 51                 for {                                                                                              
 52                         select {                                                                                   
 53                         case resp := <-webSocketClient.EventChannel:                                               
 54                                 HandleWebSocketResponse(resp)                                                      
 55                         }                                                                                          
 56                 }                                                                                                  
 57         }()     

I think in the for loop I need to add a check to ensure that the WSS is still connected and reconnect it if needed.

Can you have a recommandation on how to achieve that ?

Thanks a lot Mattermost team & folks !

@hanzei

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

Sorry for the delay @valentin2105

@crspeller Do you know how to get the status (connected, disconnected) from webSocketClient?

@crspeller

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

@valentin2105 There is a PingTimeoutChannel in WebSocketClient that gets sent to when the connection is detected as unhealthy.

@hanzei

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

@valentin2105 Would you be open to submitting a PR to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.