From 8ba687a09caa49b93b42e1280e82eff74369d3bc Mon Sep 17 00:00:00 2001 From: Son Roy Almerol Date: Mon, 9 Dec 2024 14:23:29 -0500 Subject: [PATCH] fix writer buffer --- internal/backend/backup/jobrun.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/backend/backup/jobrun.go b/internal/backend/backup/jobrun.go index f342def..4c3a639 100644 --- a/internal/backend/backup/jobrun.go +++ b/internal/backend/backup/jobrun.go @@ -205,8 +205,6 @@ func RunBackup(job *store.Job, storeInstance *store.Store, waitChan chan struct{ continue } - _, _ = writer.WriteString(line + "\n") - if strings.HasPrefix(line, "Error: upload failed:") { clientErrChan <- strings.TrimSuffix(line, "\n") } @@ -216,7 +214,7 @@ func RunBackup(job *store.Job, storeInstance *store.Store, waitChan chan struct{ writer.Flush() return default: - _, _ = io.Copy(writer, buffer) + _, _ = writer.WriteString(line + "\n") buffer.Reset() } }