summaryrefslogtreecommitdiff
path: root/worker.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-17 10:11:56 +0300
committerGitHub <[email protected]>2020-12-17 10:11:56 +0300
commita1dc59cabb6e63eab232922f4eb5a19dbd168f44 (patch)
treea35057cd5b8d22002bbd05812a3fb604ce03b705 /worker.go
parentde3c2274d0009b63ead05ddf3d699012f1d11ada (diff)
parent1033c25b6bfc752d6059e446510f651e22cbf49b (diff)
Merge pull request #448 from spiral/plugin/reloader
[RR2] Plugin/reload
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()