From bd56bd23b80796ac40d91e3985f053dc901672b0 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Tue, 8 Jul 2025 16:33:25 +0800 Subject: [PATCH] fix: update log level in crontask dist look. (#3440) --- internal/tools/cron/dist_look.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/internal/tools/cron/dist_look.go b/internal/tools/cron/dist_look.go index d1d2d1cb0..e46b9206c 100644 --- a/internal/tools/cron/dist_look.go +++ b/internal/tools/cron/dist_look.go @@ -52,15 +52,12 @@ func (e *EtcdLocker) ExecuteWithLock(ctx context.Context, taskName string, task err = mutex.TryLock(ctxWithTimeout) if err != nil { - if err == context.DeadlineExceeded { - log.ZDebug(ctx, "Task is being executed by another instance, skipping", - "taskName", taskName, - "instanceID", e.instanceID) - } else { - log.ZWarn(ctx, "Failed to acquire task lock", err, - "taskName", taskName, - "instanceID", e.instanceID) - } + // errors.Is(err, concurrency.ErrLocked) + log.ZDebug(ctx, "Task is being executed by another instance, skipping", + "taskName", taskName, + "instanceID", e.instanceID, + "error", err.Error()) + return }