Avoid sending messages out of the subp after kill

This commit is contained in:
Daniel Lugo 2021-09-23 21:53:55 -04:00
parent f3fead0559
commit 5bf02cd8f0

View file

@ -15,10 +15,15 @@ Gun.log = (...args) => {
logger.info('Gun log: ', ...args)
}
let dead = false
/**
* @param {any} msg
*/
const sendMsg = msg => {
if (dead) {
return
}
if (process.send) {
process.send(msg)
} else {
@ -65,8 +70,6 @@ const waitForAuth = async () => {
return waitForAuth()
}
let dead = false
/**
* @param {Smith.SmithMsg} msg
*/