Skip to content

Commit

Permalink
bugfix: rate limiter is not passed as pointer (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxing1292 authored Jun 28, 2018
1 parent 1e0ec6c commit ad7b522
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions service/matching/taskListManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit ad7b522

Please sign in to comment.