You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

task.go 694B

123456789101112131415161718
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package setting
  5. func newTaskService() {
  6. taskSec := Cfg.Section("task")
  7. queueTaskSec := Cfg.Section("queue.task")
  8. switch taskSec.Key("QUEUE_TYPE").MustString(ChannelQueueType) {
  9. case ChannelQueueType:
  10. queueTaskSec.Key("TYPE").MustString("persistable-channel")
  11. case RedisQueueType:
  12. queueTaskSec.Key("TYPE").MustString("redis")
  13. }
  14. queueTaskSec.Key("LENGTH").MustInt(taskSec.Key("QUEUE_LENGTH").MustInt(1000))
  15. queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString("addrs=127.0.0.1:6379 db=0"))
  16. }