Skip to content

Commit 040c64f

Browse files
authored
fix: switchdb blocking after closing destination reply (#837)
#836
1 parent 10e2003 commit 040c64f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/writer/redis_standalone_writer.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ func (w *redisStandaloneWriter) switchDbTo(newDbId int) {
9292
log.Debugf("[%s] switch db to [%d]", w.stat.Name, newDbId)
9393
w.client.Send("select", strconv.Itoa(newDbId))
9494
w.DbId = newDbId
95-
w.chWaitReply <- &entry.Entry{
96-
Argv: []string{"select", strconv.Itoa(newDbId)},
97-
CmdName: "select",
95+
if !w.offReply {
96+
w.chWaitReply <- &entry.Entry{
97+
Argv: []string{"select", strconv.Itoa(newDbId)},
98+
CmdName: "select",
99+
}
98100
}
99101
}
100102

0 commit comments

Comments
 (0)