From f88594d8c351820a9a1825862a883ba794127552 Mon Sep 17 00:00:00 2001 From: Mayank Narula Date: Fri, 10 Nov 2017 22:37:29 +0530 Subject: [PATCH] Updating Alert Server --- server.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/server.js b/server.js index 7e2a0c3..178baa5 100644 --- a/server.js +++ b/server.js @@ -233,10 +233,8 @@ function updateStateRecordWindow(){ var Now = Date.now(); var Limit = Now + 45*60*1000; - - try { - thread - .send(Limit) + + thread .run(function(limit, done, progress) { var Now = Date.now(); @@ -253,6 +251,7 @@ function updateStateRecordWindow(){ progress(Now,limit); } }) + .send(Limit) .on('progress', function(Now,limit) { if( Now >= limit ){ @@ -324,16 +323,6 @@ function updateStateRecordWindow(){ thread = null; } }); - } catch(e) { - console.log('Exception with thread : ', e.stack()); - if(e.code != "ERR_IPC_CHANNEL_CLOSED") - { - if( thread != null ){ - thread.kill(); - thread = null; - } - } - } }