From 089a202aa716f3510402ff8baf47a3b9bfaefcb8 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Tue, 15 Dec 2020 17:59:20 +0300 Subject: Update reloader to support new container --- worker.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'worker.go') diff --git a/worker.go b/worker.go index d860b3af..07c1e5c8 100755 --- a/worker.go +++ b/worker.go @@ -23,6 +23,9 @@ const ( // WaitDuration - for how long error buffer should attempt to aggregate error messages // before merging output together since lastError update (required to keep error update together). WaitDuration = 25 * time.Millisecond + + // ReadBufSize used to make a slice with specified length to read from stderr + ReadBufSize = 10240 // Kb ) // EventWorkerKill thrown after WorkerProcess is being forcefully killed. @@ -60,7 +63,7 @@ type WorkerEvent struct { var pool = sync.Pool{ New: func() interface{} { - buf := make([]byte, 10240) + buf := make([]byte, ReadBufSize) return &buf }, } @@ -164,7 +167,7 @@ func InitBaseWorker(cmd *exec.Cmd) (WorkerBase, error) { // small buffer optimization // at this point we know, that stderr will contain huge messages - w.stderr.Grow(10240) + w.stderr.Grow(ReadBufSize) go func() { w.watch() -- cgit v1.2.3