MSP-1388 [v] linter#2

This commit is contained in:
Leonid Nikolaev committed 2023-02-01 11:06:56 +03:00
1 parent 24058f5b6f
commit 44766fff0d
3 files changed
+4 -2

No files matched your search

+2
View File
@@ -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
}
+2
View File
@@ -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)
}
-2
View File
@@ -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)