Skip to content

Commit 2aa616c

Browse files
committed
change isAlive variable name to waitingForPong
1 parent 5090390 commit 2aa616c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/LiveQuery/ParseWebSocketServer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export class ParseWebSocketServer {
1414
logger.info('Parse LiveQuery Server started running');
1515
};
1616
wss.onConnection = ws => {
17-
ws.isAlive = true;
17+
ws.waitingForPong = true;
1818
ws.on('pong', () => {
19-
this.isAlive = true;
19+
this.waitingForPong = true;
2020
});
2121
ws.on('error', error => {
2222
logger.error(error.message);
@@ -25,9 +25,9 @@ export class ParseWebSocketServer {
2525
onConnect(new ParseWebSocket(ws));
2626
// Send ping to client periodically
2727
const pingIntervalId = setInterval(() => {
28-
if (ws.isAlive) {
28+
if (ws.waitingForPong) {
2929
ws.ping();
30-
ws.isAlive = false;
30+
ws.waitingForPong = false;
3131
} else {
3232
clearInterval(pingIntervalId);
3333
ws.terminate();

0 commit comments

Comments
 (0)