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