Skip to content

Commit

Permalink
fix: switchdb blocking after closing destination reply (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
EquentR authored Jul 1, 2024
1 parent 10e2003 commit 040c64f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/writer/redis_standalone_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ func (w *redisStandaloneWriter) switchDbTo(newDbId int) {
log.Debugf("[%s] switch db to [%d]", w.stat.Name, newDbId)
w.client.Send("select", strconv.Itoa(newDbId))
w.DbId = newDbId
w.chWaitReply <- &entry.Entry{
Argv: []string{"select", strconv.Itoa(newDbId)},
CmdName: "select",
if !w.offReply {
w.chWaitReply <- &entry.Entry{
Argv: []string{"select", strconv.Itoa(newDbId)},
CmdName: "select",
}
}
}

Expand Down

0 comments on commit 040c64f

Please sign in to comment.