Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
XieBiao committed Nov 19, 2017
1 parent 730c2f2 commit d5c511c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions storages/redis.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package storages

import (
"github.com/garyburd/redigo/redis"
"fmt"
"bytes"
"strings"
"fmt"
"github.com/garyburd/redigo/redis"
"strconv"
"strings"
)

type RedisClient struct {
Expand Down Expand Up @@ -89,14 +89,16 @@ func (client RedisClient) SerializedLength(key string) (uint64, error) {
reply, err := client.conn.Do("DEBUG", "OBJECT", key)
debug, err := redis.String(reply, err)

debugs := strings.Split(debug, " ")
items := strings.Split(debugs[4], ":")
if err != nil {
return 0, err
}

debugs := strings.Split(debug, " ")
items := strings.Split(debugs[4], ":")

return strconv.ParseUint(items[1], 10, 64)
}

func (client RedisClient) Close() (error) {
func (client RedisClient) Close() error {
return client.conn.Close()
}

0 comments on commit d5c511c

Please sign in to comment.