Skip to content

Commit

Permalink
feat: Add conditional logic to BeforeSendCommand callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-gang committed Jun 11, 2024
1 parent 15bf11f commit b44fec3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/resp/connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ func (c *RespConnection) SendCommand(command string, args ...string) error {
if c.Callbacks.BeforeSendCommand != nil {
if c.SentBytes > 0 {
c.Callbacks.BeforeSendCommand(true, command, args...)
} else {
c.Callbacks.BeforeSendCommand(false, command, args...)
}
c.Callbacks.BeforeSendCommand(false, command, args...)
}

encodedValue := resp_encoder.Encode(resp_value.NewStringArrayValue(append([]string{command}, args...)))
Expand Down

0 comments on commit b44fec3

Please sign in to comment.