Skip to content

Commit

Permalink
fix: error message for SlowLog conversion (#612)
Browse files Browse the repository at this point in the history
Fix incorrect offset in error message for SlowLog conversion.
  • Loading branch information
dmitri-lerko committed Jun 7, 2022
1 parent 222ca62 commit bcef0d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redis/reply.go
Expand Up @@ -614,13 +614,13 @@ func SlowLogs(result interface{}, err error) ([]SlowLog, error) {

timestamp, ok := rawLog[1].(int64)
if !ok {
return nil, fmt.Errorf("redigo: slowlog element[1] not an int64, got %T", rawLog[0])
return nil, fmt.Errorf("redigo: slowlog element[1] not an int64, got %T", rawLog[1])
}

log.Time = time.Unix(timestamp, 0)
duration, ok := rawLog[2].(int64)
if !ok {
return nil, fmt.Errorf("redigo: slowlog element[2] not an int64, got %T", rawLog[0])
return nil, fmt.Errorf("redigo: slowlog element[2] not an int64, got %T", rawLog[2])
}

log.ExecutionTime = time.Duration(duration) * time.Microsecond
Expand Down

0 comments on commit bcef0d8

Please sign in to comment.