From 5a51122289d2ee6e3428a3d879e2afeb14e3e5ab Mon Sep 17 00:00:00 2001 From: Yun Date: Fri, 19 Sep 2025 17:49:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E9=83=A8=E5=88=86=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lockx.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lockx.go b/lockx.go index a55ef46..07c15cb 100644 --- a/lockx.go +++ b/lockx.go @@ -117,7 +117,7 @@ func (g *GlobalLock) Try() (bool, error) { func (g *GlobalLock) Unlock() error { // 已经关闭就不需要重复关闭 if g.setOrGetClose() { - g.options.logger.Infof(g.ctx, "global lock already closed, key: %s, value: %s", g.uniqueKey, g.value) + // g.options.logger.Infof(g.ctx, "global lock already closed, key: %s, value: %s", g.uniqueKey, g.value) return nil } @@ -143,6 +143,7 @@ func (g *GlobalLock) Unlock() error { if delCount, ok := resp.(int64); ok && delCount == 1 { return nil } + g.options.logger.Infof(g.ctx, "global unlock may have failed: %v, key: %s, value: %s", err, g.uniqueKey, g.value) return fmt.Errorf("lock was already released or owned by another client") } @@ -159,7 +160,7 @@ func (g *GlobalLock) startRefresh() { case <-ticker.C: g.refreshExec() case <-g.ctx.Done(): - g.options.logger.Infof(g.ctx, "global lock refresh canceled, key: %s, value: %s", g.uniqueKey, g.value) + // g.options.logger.Infof(g.ctx, "global lock refresh canceled, key: %s, value: %s", g.uniqueKey, g.value) g.Unlock() return }