exit on EPIPE to avoid useless work
This commit is contained in:
parent
c5bfdc4cf3
commit
74d3935348
2 changed files with 3 additions and 1 deletions
|
@ -8,7 +8,8 @@ Known issues:
|
|||
|
||||
## bunyan 0.16.9 (not yet released)
|
||||
|
||||
(nothing yet)
|
||||
- *Exit* on EPIPE, otherwise we sit there useless processing a huge log file
|
||||
with, e.g. `bunyan huge.log | head`.
|
||||
|
||||
|
||||
## bunyan 0.16.8
|
||||
|
|
|
@ -910,6 +910,7 @@ function emit(s) {
|
|||
process.stdout.on("error", function (err) {
|
||||
if (err.code === "EPIPE") {
|
||||
// Pass. See <https://github.com/trentm/json/issues/9>.
|
||||
drainStdoutAndExit(0);
|
||||
} else {
|
||||
warn(err);
|
||||
drainStdoutAndExit(1);
|
||||
|
|
Loading…
Reference in a new issue