feat: add lock
parent
074d740817
commit
994478a00f
|
@ -74,6 +74,7 @@ func (r etcdLock) Lock(key string, unixTsToExpireNs int64) error {
|
|||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
|
||||
defer cancel()
|
||||
|
||||
if err := m.Lock(ctx); err != nil {
|
||||
_ = s.Close()
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue