Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f4932d

Browse files
committed
Update pipe commands, add key to the warn logs
1 parent 4afeace commit 9f4932d

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/full_check/client/client.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,10 @@ func (p *RedisClient) PipeTypeCommand(keyInfo []*common.Key) ([]string, error) {
272272
result[i] = v
273273
} else {
274274
result[i] = ""
275-
err := fmt.Errorf("run PipeRawCommand with commands[%s] return element[%v] isn't type string[%v], continuing",
276-
printCombinList(commands), ele, reflect.TypeOf(ele))
275+
276+
key := keyInfo[i]
277+
err := fmt.Errorf("run PipeRawCommand with commands[%s] return element[%v] isn't type string[%v], key[%s] continuing",
278+
printCombinList(commands), ele, reflect.TypeOf(ele), string(key.Key))
277279
common.Logger.Warn(err)
278280
}
279281
}
@@ -301,8 +303,9 @@ func (p *RedisClient) PipeExistsCommand(keyInfo []*common.Key) ([]int64, error)
301303
result[i] = v
302304
} else {
303305
result[i] = 0
304-
err := fmt.Errorf("run PipeRawCommand with commands[%s] return element[%v] isn't type int64[%v], continuing",
305-
printCombinList(commands), ele, reflect.TypeOf(ele))
306+
key := keyInfo[i]
307+
err := fmt.Errorf("run PipeRawCommand with commands[%s] return element[%v] isn't type int64[%v], key[%s], continuing",
308+
printCombinList(commands), ele, reflect.TypeOf(ele), string(key.Key))
306309
common.Logger.Warn(err)
307310
}
308311
}
@@ -330,8 +333,9 @@ func (p *RedisClient) PipeLenCommand(keyInfo []*common.Key) ([]int64, error) {
330333
result[i] = v
331334
} else {
332335
result[i] = 0
333-
err := fmt.Errorf("run PipeRawCommand with commands[%s] return element[%v] isn't type int64[%v], continuing",
334-
printCombinList(commands), ele, reflect.TypeOf(ele))
336+
key := keyInfo[i]
337+
err := fmt.Errorf("run PipeRawCommand with commands[%s] return element[%v] isn't type int64[%v], key[%s], continuing",
338+
printCombinList(commands), ele, reflect.TypeOf(ele), string(key.Key))
335339
common.Logger.Warn(err)
336340
}
337341
}
@@ -359,8 +363,9 @@ func (p *RedisClient) PipeTTLCommand(keyInfo []*common.Key) ([]bool, error) {
359363
result[i] = v == 0
360364
} else {
361365
result[i] = false
362-
err := fmt.Errorf("run PipeRawCommand with commands[%s] return element[%v] isn't type int64[%v], continuing",
363-
printCombinList(commands), ele, reflect.TypeOf(ele))
366+
key := keyInfo[i]
367+
err := fmt.Errorf("run PipeRawCommand with commands[%s] return element[%v] isn't type int64[%v], key[%s], continuing",
368+
printCombinList(commands), ele, reflect.TypeOf(ele), string(key.Key))
364369
common.Logger.Warn(err)
365370
}
366371
}

0 commit comments

Comments
 (0)