From 44153c33d5b616cdea928fdf87c2dae283615a1a Mon Sep 17 00:00:00 2001 From: zhpengsong <307238518@qq.com> Date: Fri, 18 Nov 2022 17:41:44 +0800 Subject: [PATCH] =?UTF-8?q?lua=E8=AE=BE=E7=BD=AE=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=BB=9F=E4=B8=80=E6=88=90=E7=A7=92=E7=BA=A7?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/lua/lock.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lua/lock.lua b/script/lua/lock.lua index 8eb0367..a491d32 100644 --- a/script/lua/lock.lua +++ b/script/lua/lock.lua @@ -2,7 +2,7 @@ local val = redis.call('get', KEYS[1]) -- 在加锁的重试的时候,要判断自己上一次是不是加锁成功了 if val == false then -- key 不存在 - return redis.call('set', KEYS[1], ARGV[1], 'PX', ARGV[2]) + return redis.call('set', KEYS[1], ARGV[1], 'EX', ARGV[2]) elseif val == ARGV[1] then -- 刷新过期时间 redis.call('expire', KEYS[1], ARGV[2])