summaryrefslogtreecommitdiffstats
path: root/modules/setting/task.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/setting/task.go')
-rw-r--r--modules/setting/task.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/setting/task.go b/modules/setting/task.go
new file mode 100644
index 0000000000..97704d4a4d
--- /dev/null
+++ b/modules/setting/task.go
@@ -0,0 +1,25 @@
+// 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
+
+var (
+ // Task settings
+ Task = struct {
+ QueueType string
+ QueueLength int
+ QueueConnStr string
+ }{
+ QueueType: ChannelQueueType,
+ QueueLength: 1000,
+ QueueConnStr: "addrs=127.0.0.1:6379 db=0",
+ }
+)
+
+func newTaskService() {
+ sec := Cfg.Section("task")
+ Task.QueueType = sec.Key("QUEUE_TYPE").MustString(ChannelQueueType)
+ Task.QueueLength = sec.Key("QUEUE_LENGTH").MustInt(1000)
+ Task.QueueConnStr = sec.Key("QUEUE_CONN_STR").MustString("addrs=127.0.0.1:6379 db=0")
+}