Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions service/matching/tasklist/task_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ dispatchLoop:
}

func (tr *taskReader) getTasksPump() {
updateAckTimer := time.NewTimer(tr.config.UpdateAckInterval())
updateAckTimer := tr.timeSource.NewTimer(tr.config.UpdateAckInterval())
defer updateAckTimer.Stop()
getTasksPumpLoop:
for {
Expand Down Expand Up @@ -235,7 +235,7 @@ getTasksPumpLoop:
// There maybe more tasks. We yield now, but signal pump to check again later.
tr.Signal()
}
case <-updateAckTimer.C:
case <-updateAckTimer.Chan():
{
ackLevel := tr.taskAckManager.GetAckLevel()
if size, err := tr.db.GetTaskListSize(ackLevel); err == nil {
Expand All @@ -248,7 +248,7 @@ getTasksPumpLoop:
// keep going as saving ack is not critical
}
tr.Signal() // periodically signal pump to check persistence for tasks
updateAckTimer = time.NewTimer(tr.config.UpdateAckInterval())
updateAckTimer.Reset(tr.config.UpdateAckInterval())
}
}
tr.scope.UpdateGauge(metrics.TaskBacklogPerTaskListGauge, float64(tr.taskAckManager.GetBacklogCount()))
Expand Down