put encoder in block to scope it from ping interval handler #30
This commit is contained in:
parent
db90e2a594
commit
b6bb04a405
@ -242,7 +242,9 @@ exports.setupWSConnection = (conn, req, { docName = req.url.slice(1).split('?')[
|
|||||||
conn.on('pong', () => {
|
conn.on('pong', () => {
|
||||||
pongReceived = true
|
pongReceived = true
|
||||||
})
|
})
|
||||||
|
// put the following in a variables in a block so the interval handlers don't keep in in
|
||||||
|
// scope
|
||||||
|
{
|
||||||
// send sync step 1
|
// send sync step 1
|
||||||
const encoder = encoding.createEncoder()
|
const encoder = encoding.createEncoder()
|
||||||
encoding.writeVarUint(encoder, messageSync)
|
encoding.writeVarUint(encoder, messageSync)
|
||||||
@ -256,3 +258,4 @@ exports.setupWSConnection = (conn, req, { docName = req.url.slice(1).split('?')[
|
|||||||
send(doc, conn, encoding.toUint8Array(encoder))
|
send(doc, conn, encoding.toUint8Array(encoder))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user