From 822583e057d114ec34c28c5788b599454bfc7739 Mon Sep 17 00:00:00 2001 From: Henning Surmeier Date: Wed, 17 Mar 2021 09:55:26 +0100 Subject: [PATCH] don't call waitGroupToChannel too often This should fix a memory leak. Before, a new channel was created every 5 seconds. --- pkg/proc/runner.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/proc/runner.go b/pkg/proc/runner.go index 85e0129..5e14b07 100644 --- a/pkg/proc/runner.go +++ b/pkg/proc/runner.go @@ -111,10 +111,11 @@ func (r *Runner) Run(ctx context.Context) error { r.exec(ctx, &wg, errChan) + wgChan := waitGroupToChannel(&wg) for { select { // wait for them all to finish, or one to fail - case <-waitGroupToChannel(&wg): + case <-wgChan: return nil // watch files