Skip to content

Commit

Permalink
fix writer buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Son Roy Almerol committed Dec 9, 2024
1 parent c422068 commit 8ba687a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/backend/backup/jobrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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()
}
}
Expand Down

0 comments on commit 8ba687a

Please sign in to comment.