summaryrefslogtreecommitdiff
path: root/worker.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-15 17:59:20 +0300
committerValery Piashchynski <[email protected]>2020-12-15 17:59:20 +0300
commit089a202aa716f3510402ff8baf47a3b9bfaefcb8 (patch)
treec0d889ab896804da239dd3e1bd16de0bdd70e379 /worker.go
parent21b51367e27f5a1b166459a115e4655d07a5d832 (diff)
Update reloader to support new container
Diffstat (limited to 'worker.go')
-rwxr-xr-xworker.go7
1 files changed, 5 insertions, 2 deletions
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()