From dfe878b8ac0700f577dc2d1a8cb3e6f0aaa8611e Mon Sep 17 00:00:00 2001 From: Sydonian <794346190@qq.com> Date: Tue, 20 Jun 2023 09:40:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B0=83=E8=AF=95=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/cmdline/distlock.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/cmdline/distlock.go b/internal/cmdline/distlock.go index 888b6ab..dea6ecc 100644 --- a/internal/cmdline/distlock.go +++ b/internal/cmdline/distlock.go @@ -7,6 +7,7 @@ import ( "github.com/samber/lo" "gitlink.org.cn/cloudream/common/pkg/distlock" "gitlink.org.cn/cloudream/common/pkg/distlock/lockprovider" + "gitlink.org.cn/cloudream/common/pkg/distlock/service" ) func DistLockLock(ctx CommandContext, lockData []string) error { @@ -21,7 +22,9 @@ func DistLockLock(ctx CommandContext, lockData []string) error { req.Locks = append(req.Locks, l) } - reqID, err := ctx.Cmdline.DistLock.Acquire(req) + reqID, err := ctx.Cmdline.DistLock.Acquire(req, service.AcquireOption{ + RetryTimeMs: 5000, + }) if err != nil { return fmt.Errorf("acquire locks failed, err: %w", err) }