From 5ca5b31efbc8eef558fbd08dc2b0b25fd7666855 Mon Sep 17 00:00:00 2001 From: Yun <995116474@qq.com> Date: Wed, 19 Jun 2024 16:31:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BB=BB=E5=8A=A1=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E9=AA=8C=E8=AF=81=E5=85=A8=E5=B1=80=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cluster.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cluster.go b/cluster.go index dc69080..c105d2b 100644 --- a/cluster.go +++ b/cluster.go @@ -216,16 +216,16 @@ func (c *Cluster) addJob(ctx context.Context, taskId string, jobData JobData, ca return err } - ctx, cancel := context.WithCancel(ctx) - defer cancel() + // ctx, cancel := context.WithCancel(ctx) + // defer cancel() - lock := lockx.NewGlobalLock(ctx, c.redis, taskId) - tB := lock.Try(2) - if !tB { - c.logger.Errorf(ctx, "添加失败:%s", taskId) - return errors.New("添加失败") - } - defer lock.Unlock() + // lock := lockx.NewGlobalLock(ctx, c.redis, taskId) + // tB := lock.Try(2) + // if !tB { + // c.logger.Errorf(ctx, "添加失败:%s", taskId) + // return errors.New("添加失败") + // } + // defer lock.Unlock() t := timerStr{ Callback: callback,