1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-01-09 15:28:22 -05:00

Queue: Add worker settings

This commit is contained in:
Andrew Thornton 2019-12-07 16:41:53 +00:00
parent 9fb051654a
commit 0edb70a099
No known key found for this signature in database
GPG key ID: 3CDE74631F13A748

View file

@ -119,7 +119,16 @@ func newQueueService() {
Queue.Timeout = sec.Key("TIMEOUT").MustDuration(GracefulHammerTime + 30*time.Second) Queue.Timeout = sec.Key("TIMEOUT").MustDuration(GracefulHammerTime + 30*time.Second)
Queue.Workers = sec.Key("WORKER").MustInt(1) Queue.Workers = sec.Key("WORKER").MustInt(1)
Cfg.Section("queue.notification").Key("WORKER").MustInt(5) hasWorkers := false
for _, key := range Cfg.Section("queue.notification").Keys() {
if key.Name() == "WORKERS" {
hasWorkers = true
break
}
}
if !hasWorkers {
Cfg.Section("queue.notification").Key("WORKERS").SetValue("5")
}
} }
// ParseQueueConnStr parses a queue connection string // ParseQueueConnStr parses a queue connection string