From 4c9f5aef6a380fd30c1827e828ac082e36260b94 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Fri, 22 Apr 2022 16:25:39 -0400 Subject: [PATCH] Ensure all bytes are written to result stream https://github.com/ansible/receptor/issues/597 --- pkg/workceptor/workceptor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/workceptor/workceptor.go b/pkg/workceptor/workceptor.go index 4cd2649e8..01e771831 100644 --- a/pkg/workceptor/workceptor.go +++ b/pkg/workceptor/workceptor.go @@ -564,8 +564,8 @@ func (w *Workceptor) GetResults(ctx context.Context, unitID string, startPos int } } if err == io.EOF { - stdoutSize := stdoutSize(unitdir) - if IsComplete(unit.Status().State) && stdoutSize >= unit.Status().StdoutSize { + unitStatus := unit.Status() + if IsComplete(unitStatus.State) && filePos >= unitStatus.StdoutSize { logger.Debug("Stdout complete - closing channel for: %s \n", unitID) return