track if couldn't send message to parent process

This commit is contained in:
Iuri Matias 2018-06-13 13:53:55 -04:00
parent 0429703790
commit a62122a6d3
1 changed files with 6 additions and 2 deletions

View File

@ -39,7 +39,10 @@ class ProcessWrapper {
} }
setInterval(() => { setInterval(() => {
try { try {
self.send({action: 'ping'}); let result = self.send({action: 'ping'});
if (!result) {
return error();
}
} catch (e) { } catch (e) {
error(); error();
} }
@ -71,9 +74,10 @@ class ProcessWrapper {
send() { send() {
if (!process.connected) { if (!process.connected) {
return; return false;
} }
process.send(...arguments); process.send(...arguments);
return true;
} }
kill() { kill() {