Skip to content
This repository was archived by the owner on Oct 3, 2021. It is now read-only.

Commit c46caf0

Browse files
author
Kaan Ozdokmeci
committed
refactored random subset from multisets to comply with redis cluster restrictions
1 parent 8c7d4e7 commit c46caf0

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/srandsubsetfrommulti.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
local main_key = KEYS[1]
2-
local from = tonumber(ARGV[1])
3-
local to = tonumber(ARGV[2])
4-
local amount = tonumber(ARGV[3])
1+
local amount = tonumber(ARGV[1])
52
local final_set = {}
63

7-
for counter = from, to do
8-
local key = main_key .. ':' .. counter
4+
for _,key in pairs(KEYS) do
95
local member_controller = {}
106
local member_controller_count = 0
117
repeat

src/srandsubsetfrommulti.lua.sha1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
870aa3bd8ea4e1ba614273069d50e5685a6c77dc
1+
da96e6e0e46ede4962fbcffc8da1ef5446d4f4e4

0 commit comments

Comments
 (0)