2024-07-01 10:56:14: merge [master:f9b2632335c35844013af97443dacebb9fc385c5];
This commit is contained in:
1 parent
cd985ff5a3
commit
6db18c1495
19 files changed
+107
-82
No files matched your search
@@ -1,3 +1,4 @@
|
||||
// nolint:dupl
|
||||
package repository
|
||||
|
||||
import (
|
||||
|
||||
@@ -27,7 +27,7 @@ func (r DailyLimit) Increment(ctx context.Context, applicationId int, today time
|
||||
}
|
||||
|
||||
if value == 1 {
|
||||
err := r.cli.ExpireNX(ctx, key, 24*time.Hour).Err() //nolint:gomnd
|
||||
err := r.cli.ExpireNX(ctx, key, 24*time.Hour).Err() //nolint:mnd,gomnd
|
||||
if err != nil {
|
||||
return 0, errors.WithMessage(err, "expire nx")
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// nolint:dupl
|
||||
package repository
|
||||
|
||||
import (
|
||||
|
||||
@@ -30,7 +30,7 @@ func (r RedisAuthCache) Get(ctx context.Context, token string) (*domain.AuthData
|
||||
p.Get(ctx, token)
|
||||
return nil
|
||||
})
|
||||
if err != nil && err != redis.Nil {
|
||||
if err != nil && !errors.Is(err, redis.Nil) {
|
||||
return nil, errors.WithMessage(err, "pipelined")
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ func (r RedisAuthzCache) Get(ctx context.Context, applicationId int, endpoint st
|
||||
p.Get(ctx, r.key(applicationId, endpoint))
|
||||
return nil
|
||||
})
|
||||
if err != nil && err != redis.Nil {
|
||||
if err != nil && !errors.Is(err, redis.Nil) {
|
||||
return false, errors.WithMessage(err, "pipelined")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user