diff --git a/distributed/locker/lock_ridis/lease.go b/distributed/locker/lock_ridis/lease.go index f245db6..6977504 100644 --- a/distributed/locker/lock_ridis/lease.go +++ b/distributed/locker/lock_ridis/lease.go @@ -101,8 +101,11 @@ func LeaseLock(lock locker.Locker, key string, expire int, ops ...options.Option } return func() error { + if cls.Load() { + return nil + } cls.Store(true) - cancel() + defer cancel() return lock.UnLock(key, mark) }, nil }