Skip to content

Commit 3f3a4f5

Browse files
authored
Avoid setitng the CONN_STR in queues unless it is meant to be set (#13025)
Since the move to common leveldb and common redis the disk queue code will check the connection string before defaulting to the DATADIR. Therefore we should ensure that the connection string is kept empty unless it is actually set. Fix #13023 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 72636fd commit 3f3a4f5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/setting/queue.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package setting
66

77
import (
88
"fmt"
9-
"path"
109
"path/filepath"
1110
"strconv"
1211
"strings"
@@ -94,7 +93,7 @@ func NewQueueService() {
9493
}
9594
Queue.Length = sec.Key("LENGTH").MustInt(20)
9695
Queue.BatchLength = sec.Key("BATCH_LENGTH").MustInt(20)
97-
Queue.ConnectionString = sec.Key("CONN_STR").MustString(path.Join(AppDataPath, ""))
96+
Queue.ConnectionString = sec.Key("CONN_STR").MustString("")
9897
Queue.Type = sec.Key("TYPE").MustString("persistable-channel")
9998
Queue.Network, Queue.Addresses, Queue.Password, Queue.DBIndex, _ = ParseQueueConnStr(Queue.ConnectionString)
10099
Queue.WrapIfNecessary = sec.Key("WRAP_IF_NECESSARY").MustBool(true)

modules/setting/task.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ func newTaskService() {
1010
switch taskSec.Key("QUEUE_TYPE").MustString(ChannelQueueType) {
1111
case ChannelQueueType:
1212
queueTaskSec.Key("TYPE").MustString("persistable-channel")
13+
queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString(""))
1314
case RedisQueueType:
1415
queueTaskSec.Key("TYPE").MustString("redis")
16+
queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString("addrs=127.0.0.1:6379 db=0"))
1517
}
1618
queueTaskSec.Key("LENGTH").MustInt(taskSec.Key("QUEUE_LENGTH").MustInt(1000))
17-
queueTaskSec.Key("CONN_STR").MustString(taskSec.Key("QUEUE_CONN_STR").MustString("addrs=127.0.0.1:6379 db=0"))
1819
}

0 commit comments

Comments
 (0)