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 1.2KB

1234567891011121314151617181920212223242526
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package setting
  4. // DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version
  5. // if these are removed, the warning will not be shown
  6. // - will need to set default for [queue.task] LENGTH to 1000 though
  7. func loadTaskFrom(rootCfg ConfigProvider) {
  8. taskSec := rootCfg.Section("task")
  9. queueTaskSec := rootCfg.Section("queue.task")
  10. deprecatedSetting(rootCfg, "task", "QUEUE_TYPE", "queue.task", "TYPE", "v1.19.0")
  11. deprecatedSetting(rootCfg, "task", "QUEUE_CONN_STR", "queue.task", "CONN_STR", "v1.19.0")
  12. deprecatedSetting(rootCfg, "task", "QUEUE_LENGTH", "queue.task", "LENGTH", "v1.19.0")
  13. switch taskSec.Key("QUEUE_TYPE").MustString("channel") {
  14. case "channel":
  15. queueTaskSec.Key("TYPE").MustString("persistable-channel")
  16. queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString(""))
  17. case "redis":
  18. queueTaskSec.Key("TYPE").MustString("redis")
  19. queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString("addrs=127.0.0.1:6379 db=0"))
  20. }
  21. queueTaskSec.Key("LENGTH").MustInt(taskSec.Key("QUEUE_LENGTH").MustInt(1000))
  22. }