Skip to content

Commit

Permalink
Merge pull request #7 from ihorserba/dont_reconnect_if_exiting
Browse files Browse the repository at this point in the history
Stop reconnecting if started to exit
  • Loading branch information
ihorserba authored Feb 22, 2021
2 parents 573bf61 + 10be6b7 commit c8fd2e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion recws.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const (

// CloseAndReconnect will try to reconnect.
func (rc *RecConn) CloseAndReconnect() {
if rc.IsConnecting() {
if rc.IsConnecting() || rc.IsExiting() {
return
}
rc.Close()
Expand Down

0 comments on commit c8fd2e5

Please sign in to comment.