From 12435d760526befe2d4c34d2ccef5bd4b7b32362 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Wed, 13 Jul 2022 11:38:15 -0400 Subject: [PATCH] potentially fix redis script --- internal/cmd/scheduler.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index 7860d29..0ad40dc 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -120,10 +120,9 @@ func SchedulerCmd(ctx context.Context) *cobra.Command { func evalScript(ctx context.Context, redis *redis.Client) (string, error) { lua := fmt.Sprintf(` local retv={} - local ids=cjson.decode(ARGV[1]) - for i=1, #ids do - local key = KEYS[1] .. ":" .. ids[i] + for i=1, #ARGV do + local key = KEYS[1] .. ":" .. ARGV[i] if redis.call("exists", key) == 0 then redis.call("setex", key, %.0f, 1) retv[#retv + 1] = ids[i]