diff options
author | Valery Piashchynski <[email protected]> | 2020-11-26 12:13:53 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-11-26 12:13:53 +0300 |
commit | 073683ebe27131cf8371decdfe309264b8ea2ad6 (patch) | |
tree | 4d5d7c114dbd1bda9a5b68f0fd1ee32b74de8906 /worker.go | |
parent | b6ade6e91e58f14c874c450201b821a048d4950d (diff) |
Truncate stderr before write, http_reset test config update
Diffstat (limited to 'worker.go')
-rwxr-xr-x | worker.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -232,7 +232,6 @@ func (w *WorkerProcess) Wait(ctx context.Context) error { // if process return code > 0, here will be an error from stderr (if presents) if w.stderr.Len() > 0 { err = multierr.Append(err, errors.E(op, errors.Str(w.stderr.String()))) - w.stderr.Truncate(0) } return multierr.Append(err, w.closeRelay()) @@ -307,7 +306,10 @@ func (w *WorkerProcess) Kill() error { func (w *WorkerProcess) Write(p []byte) (int, error) { w.mu.Lock() defer w.mu.Unlock() + // clean all previous messages in the stderr + w.stderr.Truncate(0) w.events.Push(WorkerEvent{Event: EventWorkerLog, Worker: w, Payload: p}) + // write new message w.stderr.Write(p) return len(p), nil |