kill zombie processes to reduce memory usage

This commit is contained in:
gefan 2023-02-07 00:18:48 +08:00
parent f9e6655359
commit 19e39f6321

View File

@ -18,7 +18,10 @@ module.exports = (function () {
proc.stdout.on('data', function (data) { probeData.push(data) }) proc.stdout.on('data', function (data) { probeData.push(data) })
proc.stderr.on('data', function (data) { errData.push(data) }) proc.stderr.on('data', function (data) { errData.push(data) })
proc.on('exit', code => { exitCode = code }) proc.on('exit', code => {
exitCode = code
proc.kill()
})
proc.on('error', err => reject(err)) proc.on('error', err => reject(err))
proc.on('close', () => { proc.on('close', () => {
try { try {