forked from svrjs/svrjs
When stdout is not a terminal, disable it to improve performance of SVR.JS
This commit is contained in:
parent
3a4cefa67a
commit
3839f4d1df
1 changed files with 8 additions and 0 deletions
8
svr.js
8
svr.js
|
@ -934,6 +934,14 @@ function calculateNetworkIPv4FromCidr(ipWithCidr) {
|
||||||
}).join(".");
|
}).join(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!process.stdout.isTTY) {
|
||||||
|
// When stdout is not a terminal, disable it to improve performance of SVR.JS
|
||||||
|
console.log = function () {};
|
||||||
|
process.stdout.write = function () {};
|
||||||
|
process.stdout._write = function () {};
|
||||||
|
process.stdout._writev = function () {};
|
||||||
|
}
|
||||||
|
|
||||||
// IP and network inteface-related
|
// IP and network inteface-related
|
||||||
var ifaces = {};
|
var ifaces = {};
|
||||||
var ifaceEx = null;
|
var ifaceEx = null;
|
||||||
|
|
Reference in a new issue