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 1008B

12345678910111213141516171819202122232425
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package setting
  4. // FIXME: DEPRECATED to be removed in v1.18.0
  5. // - will need to set default for [queue.task] LENGTH to 1000 though
  6. func newTaskService() {
  7. taskSec := Cfg.Section("task")
  8. queueTaskSec := Cfg.Section("queue.task")
  9. deprecatedSetting("task", "QUEUE_TYPE", "queue.task", "TYPE")
  10. deprecatedSetting("task", "QUEUE_CONN_STR", "queue.task", "CONN_STR")
  11. deprecatedSetting("task", "QUEUE_LENGTH", "queue.task", "LENGTH")
  12. switch taskSec.Key("QUEUE_TYPE").MustString("channel") {
  13. case "channel":
  14. queueTaskSec.Key("TYPE").MustString("persistable-channel")
  15. queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString(""))
  16. case "redis":
  17. queueTaskSec.Key("TYPE").MustString("redis")
  18. queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString("addrs=127.0.0.1:6379 db=0"))
  19. }
  20. queueTaskSec.Key("LENGTH").MustInt(taskSec.Key("QUEUE_LENGTH").MustInt(1000))
  21. }