diff --git a/repository/locker.go b/repository/locker.go index ab63268..8b9ae1e 100644 --- a/repository/locker.go +++ b/repository/locker.go @@ -109,6 +109,7 @@ func (rc *RC) Lock(key string, ttl time.Duration) (string, error) { mtx := rc.cli.NewMutex(key, redsync.WithExpiry(ttl)) if err := mtx.Lock(); err != nil { + // nolint: wrapcheck return "", err } @@ -131,5 +132,6 @@ func (rc *RC) UnLock(key, lockKey string) (bool, error) { rc.l.Debug(context.Background(), fmt.Sprint("ok=", ok)) + // nolint: wrapcheck return ok, err } diff --git a/service/locker.go b/service/locker.go index 6b15460..1dfbee1 100644 --- a/service/locker.go +++ b/service/locker.go @@ -20,11 +20,13 @@ type Locker struct { func (l Locker) Lock(ctx context.Context, req domain.LockRequest) (*domain.LockResponse, error) { l.logger.Debug(ctx, "call srv.Lock") + // nolint: wrapcheck return l.repo.Lock(ctx, req) } func (l Locker) UnLock(ctx context.Context, req domain.UnLockRequest) (*domain.LockResponse, error) { l.logger.Debug(ctx, "call srv.UnLock") + // nolint: wrapcheck return l.repo.UnLock(ctx, req) } diff --git a/tests/rc_test.go b/tests/rc_test.go index f3b1de4..652fa81 100644 --- a/tests/rc_test.go +++ b/tests/rc_test.go @@ -52,9 +52,7 @@ func TestOne(t *testing.T) { l, err = r.Lock(key, 10*time.Second) required.NoError(err) - n = time.Now() _, err = r.Lock(key, time.Second) - // diff = time.Since(n) required.Error(err)