Avoid sending messages out of the subp after kill
This commit is contained in:
parent
f3fead0559
commit
5bf02cd8f0
1 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue