Skip to content

Commit 5064532

Browse files
committed
bugfix: single db use cluster client
1 parent c6e0815 commit 5064532

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/full_check/full_check/scan.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func (p *FullCheck) ScanFromSourceRedis(allKeys chan<- []*common.Key) {
2929
copier.Copy(&singleHost, &p.SourceHost)
3030
// set single host address
3131
singleHost.Addr = []string{singleHost.Addr[index]}
32+
singleHost.DBType = common.TypeDB
3233
// build client by single db
3334
if sourceClient, err = client.NewRedisClient(singleHost, p.currentDB); err != nil {
3435
panic(common.Logger.Critical(err))
@@ -42,6 +43,8 @@ func (p *FullCheck) ScanFromSourceRedis(allKeys chan<- []*common.Key) {
4243
}
4344
defer sourceClient.Close()
4445

46+
common.Logger.Infof("build connection[%v]", sourceClient.String())
47+
4548
for {
4649
var reply interface{}
4750
var err error
@@ -96,6 +99,7 @@ func (p *FullCheck) ScanFromSourceRedis(allKeys chan<- []*common.Key) {
9699
Tp: common.EndKeyType,
97100
ConflictType: common.EndConflict,
98101
})
102+
// common.Logger.Debugf("read key: %v", string(bytes))
99103
}
100104
p.IncrScanStat(len(keysInfo))
101105
allKeys <- keysInfo

0 commit comments

Comments
 (0)