From a3ba57b0b831333d4ac42fcb96c021aa0c59816a Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 14 Dec 2018 23:21:33 -0700 Subject: [PATCH] Fix schedule issue --- core/scanner_tossers/ftn_bso.js | 8 ++++---- core/servers/login/websocket.js | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/scanner_tossers/ftn_bso.js b/core/scanner_tossers/ftn_bso.js index 36f0d769..47184ea9 100644 --- a/core/scanner_tossers/ftn_bso.js +++ b/core/scanner_tossers/ftn_bso.js @@ -2177,8 +2177,8 @@ FTNMessageScanTossModule.prototype.startup = function(cb) { Log.debug( { schedule : this.moduleConfig.schedule.export, - schedOK : -1 === exportSchedule.sched.error, - next : moment(later.schedule(exportSchedule.sched).next(1)).format('ddd, MMM Do, YYYY @ h:m:ss a'), + schedOK : -1 === _.get(exportSchedule, 'sched.error'), + next : exportSchedule.sched ? moment(later.schedule(exportSchedule.sched).next(1)).format('ddd, MMM Do, YYYY @ h:m:ss a') : 'N/A', immediate : exportSchedule.immediate ? true : false, }, 'Export schedule loaded' @@ -2206,8 +2206,8 @@ FTNMessageScanTossModule.prototype.startup = function(cb) { Log.debug( { schedule : this.moduleConfig.schedule.import, - schedOK : -1 === importSchedule.sched.error, - next : moment(later.schedule(importSchedule.sched).next(1)).format('ddd, MMM Do, YYYY @ h:m:ss a'), + schedOK : -1 === _.get(importSchedule, 'sched.error'), + next : importSchedule.sched ? moment(later.schedule(importSchedule.sched).next(1)).format('ddd, MMM Do, YYYY @ h:m:ss a') : 'N/A', watchFile : _.isString(importSchedule.watchFile) ? importSchedule.watchFile : 'None', }, 'Import schedule loaded' diff --git a/core/servers/login/websocket.js b/core/servers/login/websocket.js index 3fc16343..43245e74 100644 --- a/core/servers/login/websocket.js +++ b/core/servers/login/websocket.js @@ -203,7 +203,11 @@ exports.getModule = class WebSocketLoginServer extends LoginServerModule { ws.isConnectionAlive = false; // pong will reset this Log.trace('Ping to remote WebSocket client'); - return ws.ping('', false); // false=don't mask + try { + ws.ping('', false); // false=don't mask + } catch(e) { // don't barf on closing state + /* nothing */ + } }); } });