Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Commit

Permalink
chore: enhance connection closed scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
piraces committed May 19, 2023
1 parent b6dab31 commit a622cf3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/replayer/replayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ func ReplayEventsToRelays(parameters *ReplayParameters) {
continue
}

relay = connectToRelay(url)
err := relay.Connection.Ping()
if err != nil {
log.Printf("[DEBUG] ping to relay failed, reconnecting to %s because of error: %v\n", url, err)
relay = connectToRelay(url)
}
publishStatus, err := relay.Publish(context.Background(), ev.Event)
_ = relay.Close()
if err != nil {
Expand Down

0 comments on commit a622cf3

Please sign in to comment.