From 6d08792be62f4f7755541b92ea36eb23072b0ea1 Mon Sep 17 00:00:00 2001 From: Alain Gilbert Date: Thu, 18 Aug 2022 02:48:19 -0700 Subject: [PATCH] cleanup --- pkg/taskRunner/taskRunner.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/taskRunner/taskRunner.go b/pkg/taskRunner/taskRunner.go index 5d96ceff..5af3c192 100644 --- a/pkg/taskRunner/taskRunner.go +++ b/pkg/taskRunner/taskRunner.go @@ -41,11 +41,12 @@ type ITask interface { } func NewTaskRunner[T ITask](ctx context.Context, factory func() T) *TaskRunner[T] { + chanLen := 100 r := &TaskRunner[T]{} r.factory = factory r.tasks = NewPriorityQueue[*item]() - r.tasksPushCh = make(chan *item, 100) - r.tasksPopCh = make(chan struct{}, 100) + r.tasksPushCh = make(chan *item, chanLen) + r.tasksPopCh = make(chan struct{}, chanLen) r.ctx = ctx r.start() return r