bouncer/internal/setup/lock.go
William Petit f37425018b
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
feat: use shared redis client to maximize pooling usage (#39)
2024-09-23 15:16:30 +02:00

16 lines
410 B
Go

package setup
import (
"context"
"forge.cadoles.com/cadoles/bouncer/internal/config"
"forge.cadoles.com/cadoles/bouncer/internal/lock"
"forge.cadoles.com/cadoles/bouncer/internal/lock/redis"
)
func SetupLocker(ctx context.Context, conf *config.Config) (lock.Locker, error) {
client := NewSharedClient(conf.Redis)
locker := redis.NewLocker(client, int(conf.Redis.LockMaxRetries))
return locker, nil
}