Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,17 @@ func (c *Client) restoreWatchWire() *wire.WireError {
return c.restoreWire(c.watchWire)
}

func (c *Client) restoreWire(dst *ClientWire) *wire.WireError { // nolint:staticcheck
func (c *Client) restoreWire(dst *ClientWire) *wire.WireError {
slog.Warn("trying to restore connection with server...")
var err *wire.WireError
dst.Close()

dst, err = NewClientWire(maxResponseSize, c.host, c.port) // nolint:ineffassign,staticcheck
newWire, err := NewClientWire(maxResponseSize, c.host, c.port)
if err != nil {
slog.Warn("failed to restore connection with server", "error", err)
return err
}

*dst = *newWire
slog.Info("connection restored successfully")
return nil
}
Expand Down