Skip to content

Commit 512ad31

Browse files
committed
fix: remove sleep
1 parent f80eb2e commit 512ad31

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

apps/matching-service/databases/redis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ func GetRedisLock() *redislock.Client {
5050
}
5151

5252
func ObtainRedisLock(ctx context.Context) (*redislock.Lock, error) {
53-
// Retry every 100ms, for up-to 10x
54-
backoff := redislock.LimitRetry(redislock.LinearBackoff(100*time.Millisecond), 10)
53+
// Retry every 100ms, for up-to 100x
54+
backoff := redislock.LimitRetry(redislock.LinearBackoff(100*time.Millisecond), 100)
5555

5656
// Obtain lock with retry
5757
lock, err := redisLock.Obtain(ctx, matchmakingRedisLock, time.Second, &redislock.Options{

apps/matching-service/processes/performmatches.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"matching-service/databases"
1010
"matching-service/models"
1111
"matching-service/utils"
12-
"time"
1312

1413
"github.com/redis/go-redis/v9"
1514
)
@@ -74,8 +73,6 @@ func PerformMatching(rdb *redis.Client, matchRequest models.MatchRequest, ctx co
7473
publishMatch(tx, ctx, matchedUsername, currentUsername, matchFound)
7574
}
7675

77-
time.Sleep(time.Duration(time.Second * 1))
78-
7976
return nil
8077
}); err != nil {
8178
// return

0 commit comments

Comments
 (0)