fix router constructor

This commit is contained in:
ycc 2023-08-31 23:43:36 +02:00
parent d082724432
commit 539e2c528e

View File

@ -17,15 +17,16 @@ type RedisRouter struct {
Context context.Context Context context.Context
} }
func NewRedisRouter(server *Identity, url string, password string, db int) *RedisRouter { func NewRedisRouter(server *Identity, redisUrl string, password string, db int, invitationTimeout int) *RedisRouter {
var r RedisRouter var r RedisRouter
r.ServerIdentity = server r.ServerIdentity = server
r.Name = "Redis" r.Name = "Redis"
r.Client = redis.NewClient(&redis.Options{ r.Client = redis.NewClient(&redis.Options{
Addr: url, Addr: redisUrl,
Password: password, Password: password,
DB: db, DB: db,
}) })
r.InvitationTimeout = invitationTimeout
r.Context = context.Background() r.Context = context.Background()
return &r return &r
} }