From 5bf02cd8f0247f955289d246fb9e668d560fd1df Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Thu, 23 Sep 2021 21:53:55 -0400 Subject: [PATCH] Avoid sending messages out of the subp after kill --- utils/GunSmith/gun.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/GunSmith/gun.js b/utils/GunSmith/gun.js index c97f9caa..4ac4d38b 100644 --- a/utils/GunSmith/gun.js +++ b/utils/GunSmith/gun.js @@ -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 */