Fixing error where connection was re-established incorrectly

This commit is contained in:
2023-09-25 15:25:43 -05:00
parent 896bafe70b
commit 12bd5e6a01
2 changed files with 12 additions and 0 deletions

View File

@ -113,7 +113,15 @@ func (d *Dispatcher) dispatchMessage(msg *message.Message) {
return
}
log.Println("Websocket terminated: reconnecting")
err := d.Disconnect()
if err != nil {
log.Println(err)
}
d.Connect()
if err != nil {
log.Println(err)
}
subsList := d.store.GetAll()
for i := range subsList {
sub := subsList[i]