From a62122a6d35558ad1561166eedb53f0ba2035084 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 13 Jun 2018 13:53:55 -0400 Subject: [PATCH 1/3] track if couldn't send message to parent process --- lib/process/processWrapper.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/process/processWrapper.js b/lib/process/processWrapper.js index 6096d9e5..3119f455 100644 --- a/lib/process/processWrapper.js +++ b/lib/process/processWrapper.js @@ -39,7 +39,10 @@ class ProcessWrapper { } setInterval(() => { try { - self.send({action: 'ping'}); + let result = self.send({action: 'ping'}); + if (!result) { + return error(); + } } catch (e) { error(); } @@ -71,9 +74,10 @@ class ProcessWrapper { send() { if (!process.connected) { - return; + return false; } process.send(...arguments); + return true; } kill() { From 9219c1792475c6d849eb817671b0e103cb090e24 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 13 Jun 2018 14:00:21 -0400 Subject: [PATCH 2/3] return process send --- lib/process/processWrapper.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/process/processWrapper.js b/lib/process/processWrapper.js index 3119f455..7a679eaa 100644 --- a/lib/process/processWrapper.js +++ b/lib/process/processWrapper.js @@ -76,8 +76,7 @@ class ProcessWrapper { if (!process.connected) { return false; } - process.send(...arguments); - return true; + return process.send(...arguments); } kill() { From f1f4f2520cba2801766b60dabb8d132f63ff6dba Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 13 Jun 2018 14:09:59 -0400 Subject: [PATCH 3/3] reset counter --- lib/process/processWrapper.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/process/processWrapper.js b/lib/process/processWrapper.js index 7a679eaa..f4eda695 100644 --- a/lib/process/processWrapper.js +++ b/lib/process/processWrapper.js @@ -43,6 +43,7 @@ class ProcessWrapper { if (!result) { return error(); } + self.retries = 0; } catch (e) { error(); }