forked from forgejo/forgejo
Remove dependency on queue from setting
This commit is contained in:
parent
8798a61ba4
commit
030b6d91c8
7 changed files with 91 additions and 66 deletions
|
@ -4,16 +4,14 @@
|
|||
|
||||
package setting
|
||||
|
||||
import "code.gitea.io/gitea/modules/queue"
|
||||
|
||||
func newTaskService() {
|
||||
taskSec := Cfg.Section("task")
|
||||
queueTaskSec := Cfg.Section("queue.task")
|
||||
switch taskSec.Key("QUEUE_TYPE").MustString(ChannelQueueType) {
|
||||
case ChannelQueueType:
|
||||
queueTaskSec.Key("TYPE").MustString(string(queue.PersistableChannelQueueType))
|
||||
queueTaskSec.Key("TYPE").MustString("persistable-channel")
|
||||
case RedisQueueType:
|
||||
queueTaskSec.Key("TYPE").MustString(string(queue.RedisQueueType))
|
||||
queueTaskSec.Key("TYPE").MustString("redis")
|
||||
}
|
||||
queueTaskSec.Key("LENGTH").MustInt(taskSec.Key("QUEUE_LENGTH").MustInt(1000))
|
||||
queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString("addrs=127.0.0.1:6379 db=0"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue