Skip to content

Commit

Permalink
redis: Fix List call to strip table prefix from result
Browse files Browse the repository at this point in the history
The plugin stores the keys prefixed with the "Table" name in Redis. We
should remove that prefix from the keys returned by "List()".

Partial-Fix: micro#57
  • Loading branch information
rhafer committed May 10, 2023
1 parent c290133 commit fbe58d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions v4/store/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package redis
import (
"context"
"fmt"
"strings"
"time"

"github.com/go-redis/redis/v8"
Expand Down Expand Up @@ -175,6 +176,10 @@ func (r *rkv) List(opts ...store.ListOption) ([]string, error) {
return nil, err
}

for i, key := range keys {
keys[i] = strings.TrimPrefix(key, options.Table)
}

allKeys = append(allKeys, keys...)

if cursor == 0 {
Expand Down

0 comments on commit fbe58d5

Please sign in to comment.