From ad7b5227b5064932db83d21bce005da27a33d762 Mon Sep 17 00:00:00 2001 From: wxing1292 Date: Thu, 28 Jun 2018 13:31:50 -0700 Subject: [PATCH] bugfix: rate limiter is not passed as pointer (#906) --- service/matching/taskListManager.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/matching/taskListManager.go b/service/matching/taskListManager.go index 22bc9d62750..cb750e7e7ef 100644 --- a/service/matching/taskListManager.go +++ b/service/matching/taskListManager.go @@ -129,8 +129,8 @@ type rateLimiter struct { minBurst int } -func newRateLimiter(maxDispatchPerSecond *float64, ttl time.Duration, minBurst int) rateLimiter { - rl := rateLimiter{ +func newRateLimiter(maxDispatchPerSecond *float64, ttl time.Duration, minBurst int) *rateLimiter { + rl := &rateLimiter{ maxDispatchPerSecond: maxDispatchPerSecond, ttl: ttl, ttlTimer: time.NewTimer(ttl), @@ -205,7 +205,7 @@ func newTaskListManager( func newTaskListManagerWithRateLimiter( e *matchingEngineImpl, taskList *taskListID, taskListKind *s.TaskListKind, config *taskListConfig, - rl rateLimiter, + rl *rateLimiter, ) taskListManager { // To perform one db operation if there are no pollers taskBufferSize := config.GetTasksBatchSize() - 1 @@ -303,7 +303,7 @@ type taskListManagerImpl struct { outstandingPollsLock sync.Mutex outstandingPollsMap map[string]context.CancelFunc // Rate limiter for task dispatch - rateLimiter rateLimiter + rateLimiter *rateLimiter taskListKind *s.TaskListKind // sticky taskList has different process in persistence }