mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-23 06:16:55 +08:00
3f3a4f5b41
Since the move to common leveldb and common redis the disk queue code will check the connection string before defaulting to the DATADIR. Therefore we should ensure that the connection string is kept empty unless it is actually set. Fix #13023 Signed-off-by: Andrew Thornton <art27@cantab.net>
20 lines
783 B
Go
20 lines
783 B
Go
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package setting
|
|
|
|
func newTaskService() {
|
|
taskSec := Cfg.Section("task")
|
|
queueTaskSec := Cfg.Section("queue.task")
|
|
switch taskSec.Key("QUEUE_TYPE").MustString(ChannelQueueType) {
|
|
case ChannelQueueType:
|
|
queueTaskSec.Key("TYPE").MustString("persistable-channel")
|
|
queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString(""))
|
|
case RedisQueueType:
|
|
queueTaskSec.Key("TYPE").MustString("redis")
|
|
queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString("addrs=127.0.0.1:6379 db=0"))
|
|
}
|
|
queueTaskSec.Key("LENGTH").MustInt(taskSec.Key("QUEUE_LENGTH").MustInt(1000))
|
|
}
|