1
0
Fork 0
forked from forgejo/forgejo

Queue: Allow Redis to connect to unix

This commit is contained in:
Andrew Thornton 2019-12-17 19:44:37 +00:00
parent 1013ced326
commit 1fb9104009
No known key found for this signature in database
GPG key ID: 3CDE74631F13A748
2 changed files with 9 additions and 3 deletions

View file

@ -41,6 +41,7 @@ type RedisQueue struct {
// RedisQueueConfiguration is the configuration for the redis queue
type RedisQueueConfiguration struct {
Network string
Addresses string
Password string
DBIndex int
@ -88,6 +89,7 @@ func NewRedisQueue(handle HandlerFunc, cfg, exemplar interface{}) (Queue, error)
return nil, errors.New("no redis host found")
} else if len(dbs) == 1 {
queue.client = redis.NewClient(&redis.Options{
Network: config.Network,
Addr: strings.TrimSpace(dbs[0]), // use default Addr
Password: config.Password, // no password set
DB: config.DBIndex, // use default DB