From cf25d82880457961aa6a0458ddf8a785a53b212f Mon Sep 17 00:00:00 2001 From: libin Date: Mon, 15 Jul 2024 15:33:35 +0800 Subject: [PATCH] Adjust the automatic renewal time --- lock_redis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lock_redis.go b/lock_redis.go index 41a7e9e..da39d8d 100644 --- a/lock_redis.go +++ b/lock_redis.go @@ -107,7 +107,7 @@ func (lock *RedisLock) Renew() error { // 锁自动续期 func (lock *RedisLock) autoRenew() { - ticker := time.NewTicker(lock.lockTimeout / 2) + ticker := time.NewTicker(lock.lockTimeout / 3) defer ticker.Stop() for {