Skip to content

Commit 1f83b4f

Browse files
committed
Rename QUEUE_NAME REDIS_QUEUE_NAME
1 parent a74b473 commit 1f83b4f

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

docs/content/doc/advanced/config-cheat-sheet.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ relation to port exhaustion.
247247
- `LENGTH`: **20**: Maximal queue size before channel queues block
248248
- `BATCH_LENGTH`: **20**: Batch data before passing to the handler
249249
- `CONN_STR`: **addrs=127.0.0.1:6379 db=0**: Connection string for the redis queue type.
250-
- `QUEUE_NAME`: **_queue**: The suffix for default redis queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overriden in the specific `queue.name` section.
250+
- `REDIS_QUEUE_NAME`: **_queue**: The suffix for default redis queue name. Individual queues will default to **`name`**`REDIS_QUEUE_NAME` but can be overriden in the specific `queue.name` section.
251251
- `WRAP_IF_NECESSARY`: **true**: Will wrap queues with a timeoutable queue if the selected queue is not ready to be created - (Only relevant for the level queue.)
252252
- `MAX_ATTEMPTS`: **10**: Maximum number of attempts to create the wrapped queue
253253
- `TIMEOUT`: **GRACEFUL_HAMMER_TIME + 30s**: Timeout the creation of the wrapped queue if it takes longer than this to create.

modules/queue/queue_redis.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ type RedisQueue struct {
4444

4545
// RedisQueueConfiguration is the configuration for the redis queue
4646
type RedisQueueConfiguration struct {
47-
Network string
48-
Addresses string
49-
Password string
50-
DBIndex int
51-
BatchLength int
52-
QueueLength int
53-
QueueName string
54-
Workers int
55-
MaxWorkers int
56-
BlockTimeout time.Duration
57-
BoostTimeout time.Duration
58-
BoostWorkers int
59-
Name string
47+
Network string
48+
Addresses string
49+
Password string
50+
DBIndex int
51+
BatchLength int
52+
QueueLength int
53+
RedisQueueName string
54+
Workers int
55+
MaxWorkers int
56+
BlockTimeout time.Duration
57+
BoostTimeout time.Duration
58+
BoostWorkers int
59+
Name string
6060
}
6161

6262
// NewRedisQueue creates single redis or cluster redis queue
@@ -84,7 +84,7 @@ func NewRedisQueue(handle HandlerFunc, cfg, exemplar interface{}) (Queue, error)
8484
boostWorkers: config.BoostWorkers,
8585
maxNumberOfWorkers: config.MaxWorkers,
8686
},
87-
queueName: config.QueueName,
87+
queueName: config.RedisQueueName,
8888
exemplar: exemplar,
8989
closed: make(chan struct{}),
9090
workers: config.Workers,

modules/queue/setting.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func CreateQueue(name string, handle HandlerFunc, exemplar interface{}) Queue {
3636
opts["Network"] = q.Network
3737
opts["Password"] = q.Password
3838
opts["DBIndex"] = q.DBIndex
39-
opts["QueueName"] = q.QueueName
39+
opts["RedisQueueName"] = q.RedisQueueName
4040
opts["Workers"] = q.Workers
4141
opts["MaxWorkers"] = q.MaxWorkers
4242
opts["BlockTimeout"] = q.BlockTimeout

modules/setting/queue.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type QueueSettings struct {
2424
Network string
2525
Addresses string
2626
Password string
27-
QueueName string
27+
RedisQueueName string
2828
DBIndex int
2929
WrapIfNecessary bool
3030
MaxAttempts int
@@ -45,14 +45,14 @@ func GetQueueSettings(name string) QueueSettings {
4545
sec := Cfg.Section("queue." + name)
4646
// DataDir is not directly inheritable
4747
q.DataDir = path.Join(Queue.DataDir, name)
48-
// QueueName is not directly inheritable either
49-
q.QueueName = name + Queue.QueueName
48+
// RedisQueueName is not directly inheritable either
49+
q.RedisQueueName = name + Queue.RedisQueueName
5050
for _, key := range sec.Keys() {
5151
switch key.Name() {
5252
case "DATADIR":
5353
q.DataDir = key.MustString(q.DataDir)
54-
case "QUEUE_NAME":
55-
q.QueueName = key.MustString(q.QueueName)
54+
case "REDIS_QUEUE_NAME":
55+
q.RedisQueueName = key.MustString(q.RedisQueueName)
5656
}
5757
}
5858
if !path.IsAbs(q.DataDir) {
@@ -98,7 +98,7 @@ func NewQueueService() {
9898
Queue.BlockTimeout = sec.Key("BLOCK_TIMEOUT").MustDuration(1 * time.Second)
9999
Queue.BoostTimeout = sec.Key("BOOST_TIMEOUT").MustDuration(5 * time.Minute)
100100
Queue.BoostWorkers = sec.Key("BOOST_WORKERS").MustInt(5)
101-
Queue.QueueName = sec.Key("QUEUE_NAME").MustString("_queue")
101+
Queue.RedisQueueName = sec.Key("REDIS_QUEUE_NAME").MustString("_queue")
102102

103103
// Now handle the old issue_indexer configuration
104104
section := Cfg.Section("queue.issue_indexer")

0 commit comments

Comments
 (0)