Skip to content

Commit

Permalink
[v2] Redis Lists: default to list type if none specified (#1075)
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <[email protected]>
  • Loading branch information
zroubalik authored Sep 3, 2020
1 parent ea116fc commit ccdfb8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/scalers/redis_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func getRedisListLength(ctx context.Context, address string, password string, li

var cmd *redis.IntCmd
switch listType.Val() {
case "list":
case "list", "none":
cmd = client.LLen(listName)
case "set":
cmd = client.SCard(listName)
Expand All @@ -228,7 +228,7 @@ func getRedisListLength(ctx context.Context, address string, password string, li
}

if cmd == nil {
return -1, fmt.Errorf("list must be of type:list,set,hash,zset but was %s", listType.Val())
return -1, fmt.Errorf("list must be of type: list, none, set, hash or zset but was %s", listType.Val())
}
if cmd.Err() != nil {
return -1, cmd.Err()
Expand Down

0 comments on commit ccdfb8d

Please sign in to comment.