diff options
author | Valery Piashchynski <[email protected]> | 2020-12-17 10:11:56 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-17 10:11:56 +0300 |
commit | a1dc59cabb6e63eab232922f4eb5a19dbd168f44 (patch) | |
tree | a35057cd5b8d22002bbd05812a3fb604ce03b705 /worker.go | |
parent | de3c2274d0009b63ead05ddf3d699012f1d11ada (diff) | |
parent | 1033c25b6bfc752d6059e446510f651e22cbf49b (diff) |
Merge pull request #448 from spiral/plugin/reloader
[RR2] Plugin/reload
Diffstat (limited to 'worker.go')
-rwxr-xr-x | worker.go | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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() |