remove comment.

This commit is contained in:
Monet Lee 2025-06-03 16:49:47 +08:00
parent e42126687c
commit cdf3e9cdb3

View File

@ -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