File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,12 @@ type Config struct {
185185 // StrictPriority: true,
186186 DynamicQueues bool
187187
188+ // DynamicQueueUpdateInterval specifies the interval between updating list of dynamic queue names.
189+ // Parameter corresponds with the latency of the server to pick up the first task from a newly created dynamic queue.
190+ //
191+ // If unset or zero, default interval of 5 seconds is used.
192+ DynamicQueueUpdateInterval time.Duration
193+
188194 // ErrorHandler handles errors returned by the task handler.
189195 //
190196 // HandleError is invoked only if the task handler returns a non-nil error.
@@ -535,10 +541,14 @@ func NewServerFromRedisClient(c redis.UniversalClient, cfg Config) *Server {
535541 srvState := & serverState {value : srvStateNew }
536542 cancels := base .NewCancelations ()
537543
544+ dynamicQueueUpdateInterval := cfg .DynamicQueueUpdateInterval
545+ if dynamicQueueUpdateInterval == 0 {
546+ dynamicQueueUpdateInterval = defaultDynamicQueueUpdateInterval
547+ }
538548 queueManager := newQueueManager (queueManagerParams {
539549 logger : logger ,
540550 broker : rdb ,
541- interval : defaultDynamicQueueUpdateInterval ,
551+ interval : dynamicQueueUpdateInterval ,
542552 queues : queues ,
543553 strictPriority : cfg .StrictPriority ,
544554 dynamicQueues : cfg .DynamicQueues ,
You can’t perform that action at this time.
0 commit comments