From 00a5c4729e39e3c38336ee2772b9619f45d11fdd Mon Sep 17 00:00:00 2001 From: riabovvo Date: Mon, 15 May 2023 11:38:13 +0300 Subject: [PATCH] MSP-1540 remove redundant logging on controller/repo/service --- controller/locker.go | 2 -- repository/locker.go | 4 ---- service/locker.go | 2 -- 3 files changed, 8 deletions(-) diff --git a/controller/locker.go b/controller/locker.go index 4963ab4..8735547 100644 --- a/controller/locker.go +++ b/controller/locker.go @@ -29,7 +29,6 @@ type Locker struct { // @Success 200 {object} domain.LockResponse // @Router /api/isp-lock-service/lock [POST] func (l Locker) Lock(ctx context.Context, req domain.LockRequest) (*domain.LockResponse, error) { - l.logger.Debug(ctx, "call ctrl.Lock") return l.s.Lock(ctx, req) } @@ -43,7 +42,6 @@ func (l Locker) Lock(ctx context.Context, req domain.LockRequest) (*domain.LockR // @Success 200 // @Router /api/isp-lock-service/unlock [POST] func (l Locker) UnLock(ctx context.Context, req domain.UnLockRequest) (*domain.LockResponse, error) { - l.logger.Debug(ctx, "call ctrl.UnLock") return l.s.UnLock(ctx, req) } diff --git a/repository/locker.go b/repository/locker.go index cb57e6e..a0e5cd5 100644 --- a/repository/locker.go +++ b/repository/locker.go @@ -47,8 +47,6 @@ func NewLocker(logger log.Logger, cfg conf.Remote) Locker { } func (l Locker) Lock(ctx context.Context, key string, ttl int) (*domain.LockResponse, error) { - l.logger.Debug(ctx, "call repo.Lock") - key = makeKey(l.prefix, key) mtx := l.cli.NewMutex(key, redsync.WithExpiry(time.Duration(ttl)*time.Second)) @@ -63,8 +61,6 @@ func (l Locker) Lock(ctx context.Context, key string, ttl int) (*domain.LockResp } func (l Locker) UnLock(ctx context.Context, key, lockKey string) (*domain.LockResponse, error) { - l.logger.Debug(ctx, "call repo.UnLock") - key = makeKey(l.prefix, key) _, err := l.cli.NewMutex(key, redsync.WithValue(lockKey)).Unlock() diff --git a/service/locker.go b/service/locker.go index 462b73a..cf900d1 100644 --- a/service/locker.go +++ b/service/locker.go @@ -19,13 +19,11 @@ 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.Key, req.TTLInSec) } 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.Key, req.LockKey) }