mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-06-26 14:19:38 +08:00
remove comment.
This commit is contained in:
parent
e42126687c
commit
cdf3e9cdb3
@ -144,14 +144,12 @@ func (e *EtcdLocker) runKeepAlive(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watch lock status directly in etcd
|
|
||||||
func (e *EtcdLocker) watchLock(ctx context.Context) {
|
func (e *EtcdLocker) watchLock(ctx context.Context) {
|
||||||
log.ZInfo(ctx, "Starting to watch lock status", "instanceID", e.instanceID)
|
log.ZInfo(ctx, "Starting to watch lock status", "instanceID", e.instanceID)
|
||||||
watchCtx, cancel := context.WithCancel(ctx)
|
watchCtx, cancel := context.WithCancel(ctx)
|
||||||
e.watchCancel = cancel
|
e.watchCancel = cancel
|
||||||
defer e.cancelWatch()
|
defer e.cancelWatch()
|
||||||
|
|
||||||
// Watch for changes to the lock key
|
|
||||||
e.watchCh = e.client.Watch(watchCtx, lockKey)
|
e.watchCh = e.client.Watch(watchCtx, lockKey)
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
@ -174,7 +172,6 @@ func (e *EtcdLocker) watchLock(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release the lock
|
|
||||||
func (e *EtcdLocker) releaseLock(ctx context.Context) {
|
func (e *EtcdLocker) releaseLock(ctx context.Context) {
|
||||||
if atomic.LoadInt32(&e.isLockOwner) == 0 {
|
if atomic.LoadInt32(&e.isLockOwner) == 0 {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user