File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ export class ParseWebSocketServer {
14
14
logger . info ( 'Parse LiveQuery Server started running' ) ;
15
15
} ;
16
16
wss . onConnection = ws => {
17
- ws . waitingForPong = true ;
17
+ ws . waitingForPong = false ;
18
18
ws . on ( 'pong' , ( ) => {
19
- this . waitingForPong = true ;
19
+ this . waitingForPong = false ;
20
20
} ) ;
21
21
ws . on ( 'error' , error => {
22
22
logger . error ( error . message ) ;
@@ -25,9 +25,9 @@ export class ParseWebSocketServer {
25
25
onConnect ( new ParseWebSocket ( ws ) ) ;
26
26
// Send ping to client periodically
27
27
const pingIntervalId = setInterval ( ( ) => {
28
- if ( ws . waitingForPong ) {
28
+ if ( ! ws . waitingForPong ) {
29
29
ws . ping ( ) ;
30
- ws . waitingForPong = false ;
30
+ ws . waitingForPong = true ;
31
31
} else {
32
32
clearInterval ( pingIntervalId ) ;
33
33
ws . terminate ( ) ;
You can’t perform that action at this time.
0 commit comments