summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-08-31 04:33:16 +0100
committerGitHub <noreply@github.com>2021-08-31 05:33:16 +0200
commitf2b4b0f491014753f509eccbcd157c198dd287b3 (patch)
tree5afd506ba1bc46e50fbe5afff00ea91028f14ec5 /modules
parent6d97befddf8bfc712d1d38844fa77ff322eb09d0 (diff)
downloadgitea-f2b4b0f491014753f509eccbcd157c198dd287b3.tar.gz
gitea-f2b4b0f491014753f509eccbcd157c198dd287b3.zip
Remove ParseQueueConnStr as it is unused (#16878)
Remove ParseQueueConnStr as `modules/nosql` has taken over all of its functions. Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/queue.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/modules/setting/queue.go b/modules/setting/queue.go
index 4ff02b61eb..76b7dc1faf 100644
--- a/modules/setting/queue.go
+++ b/modules/setting/queue.go
@@ -7,8 +7,6 @@ package setting
import (
"fmt"
"path/filepath"
- "strconv"
- "strings"
"time"
"code.gitea.io/gitea/modules/log"
@@ -22,12 +20,8 @@ type QueueSettings struct {
BatchLength int
ConnectionString string
Type string
- Network string
- Addresses string
- Password string
QueueName string
SetName string
- DBIndex int
WrapIfNecessary bool
MaxAttempts int
Timeout time.Duration
@@ -83,7 +77,6 @@ func GetQueueSettings(name string) QueueSettings {
q.BoostTimeout = sec.Key("BOOST_TIMEOUT").MustDuration(Queue.BoostTimeout)
q.BoostWorkers = sec.Key("BOOST_WORKERS").MustInt(Queue.BoostWorkers)
- q.Network, q.Addresses, q.Password, q.DBIndex, _ = ParseQueueConnStr(q.ConnectionString)
return q
}
@@ -100,7 +93,6 @@ func NewQueueService() {
Queue.ConnectionString = sec.Key("CONN_STR").MustString("")
defaultType := sec.Key("TYPE").String()
Queue.Type = sec.Key("TYPE").MustString("persistable-channel")
- Queue.Network, Queue.Addresses, Queue.Password, Queue.DBIndex, _ = ParseQueueConnStr(Queue.ConnectionString)
Queue.WrapIfNecessary = sec.Key("WRAP_IF_NECESSARY").MustBool(true)
Queue.MaxAttempts = sec.Key("MAX_ATTEMPTS").MustInt(10)
Queue.Timeout = sec.Key("TIMEOUT").MustDuration(GracefulHammerTime + 30*time.Second)
@@ -167,28 +159,3 @@ func NewQueueService() {
_, _ = section.NewKey("LENGTH", fmt.Sprintf("%d", Repository.PullRequestQueueLength))
}
}
-
-// ParseQueueConnStr parses a queue connection string
-func ParseQueueConnStr(connStr string) (network, addrs, password string, dbIdx int, err error) {
- fields := strings.Fields(connStr)
- for _, f := range fields {
- items := strings.SplitN(f, "=", 2)
- if len(items) < 2 {
- continue
- }
- switch strings.ToLower(items[0]) {
- case "network":
- network = items[1]
- case "addrs":
- addrs = items[1]
- case "password":
- password = items[1]
- case "db":
- dbIdx, err = strconv.Atoi(items[1])
- if err != nil {
- return
- }
- }
- }
- return
-}