summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-21 16:08:06 +0300
committerValery Piashchynski <[email protected]>2021-01-21 16:08:06 +0300
commit8029e2d1107e4663f1104ebf25c40f252c8ea111 (patch)
tree7c9a6744fa9ce130d80c634da3d7596f70fda51a /pkg
parent7da6c78449776e1f3c6716250bca0b712a0423a4 (diff)
Fix headers configs
Update rr.yaml Remove previous stderr messages when they were sent
Diffstat (limited to 'pkg')
-rwxr-xr-xpkg/worker/worker.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/worker/worker.go b/pkg/worker/worker.go
index 4d4ca09b..bf70d646 100755
--- a/pkg/worker/worker.go
+++ b/pkg/worker/worker.go
@@ -79,6 +79,7 @@ type Process struct {
// InitBaseWorker creates new Process over given exec.cmd.
func InitBaseWorker(cmd *exec.Cmd, options ...Options) (worker.BaseProcess, error) {
+ const op = errors.Op("init_base_worker")
if cmd.Process != nil {
return nil, fmt.Errorf("can't attach to running process")
}
@@ -307,9 +308,10 @@ func (w *Process) watch() {
n, _ := w.rd.Read(*buf)
w.events.Push(events.WorkerEvent{Event: events.EventWorkerLog, Worker: w, Payload: (*buf)[:n]})
w.mu.Lock()
+ // delete all prev messages
+ w.stderr.Reset()
// write new message
w.stderr.Write((*buf)[:n])
- w.stderr.Reset()
w.mu.Unlock()
w.put(buf)
}