mirror of
https://github.com/kataras/iris.git
synced 2026-01-10 05:25:58 +00:00
@@ -263,7 +263,12 @@ func (r *RadixDriver) getKeys(cursor, prefix string) ([]string, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
keys := res.keys[0:]
|
||||
if len(res.keys) <= 1 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
keys := res.keys[1:] // the first one is always the session id itself.
|
||||
|
||||
if res.cur != "0" {
|
||||
moreKeys, err := r.getKeys(res.cur, prefix)
|
||||
if err != nil {
|
||||
|
||||
@@ -205,10 +205,19 @@ func (r *RedigoDriver) getKeysConn(c redis.Conn, cursor interface{}, prefix stri
|
||||
if len(replies) == 2 {
|
||||
// take the second, it must contain the slice of keys.
|
||||
if keysSliceAsBytes, ok := replies[1].([]interface{}); ok {
|
||||
keys := make([]string, len(keysSliceAsBytes))
|
||||
n := len(keysSliceAsBytes) - 1 // scan match returns the session id key too.
|
||||
if n <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
keys := make([]string, n)
|
||||
|
||||
for i, k := range keysSliceAsBytes {
|
||||
keys[i] = fmt.Sprintf("%s", k)[len(r.Config.Prefix):]
|
||||
key := fmt.Sprintf("%s", k)[len(r.Config.Prefix):]
|
||||
if key == prefix {
|
||||
continue // it's the session id itself.
|
||||
}
|
||||
keys[i] = key
|
||||
}
|
||||
|
||||
if cur := fmt.Sprintf("%s", replies[0]); cur != "0" {
|
||||
|
||||
Reference in New Issue
Block a user