Remove heartbeat when client exits mrc

This commit is contained in:
David Stephens 2019-05-26 23:44:38 +01:00
parent 27e3d50c5d
commit 2c3219fc67
1 changed files with 2 additions and 1 deletions

View File

@ -112,6 +112,7 @@ exports.getModule = class mrcModule extends MenuModule {
quit : (formData, extraArgs, cb) => { quit : (formData, extraArgs, cb) => {
this.sendServerMessage('LOGOFF'); this.sendServerMessage('LOGOFF');
clearInterval(this.heartbeat);
this.state.socket.destroy(); this.state.socket.destroy();
return this.prevMenu(cb); return this.prevMenu(cb);
} }
@ -147,7 +148,7 @@ exports.getModule = class mrcModule extends MenuModule {
self.clientConnect(); self.clientConnect();
// send register to central MRC and get stats every 60s // send register to central MRC and get stats every 60s
setInterval(function () { self.heartbeat = setInterval(function () {
self.sendHeartbeat(); self.sendHeartbeat();
self.sendServerMessage('STATS'); self.sendServerMessage('STATS');
}, 60000); }, 60000);