Skip to content

Commit

Permalink
Merge pull request #241 from filimonov/patch-1
Browse files Browse the repository at this point in the history
fix: reset WriteDeadline
  • Loading branch information
ernado authored Jan 26, 2023
2 parents 2fad15a + f2e3022 commit a409ea7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ func (c *Client) flushBuf(ctx context.Context, b *proto.Buffer) error {
if err := c.conn.SetWriteDeadline(deadline); err != nil {
return errors.Wrap(err, "set write deadline")
}
// Reset deadline.
defer func() { _ = c.conn.SetWriteDeadline(time.Time{}) }()
}
n, err := c.conn.Write(b.Buf)
if err != nil {
Expand Down

0 comments on commit a409ea7

Please sign in to comment.