Open socket when re-sending pending messages

This commit is contained in:
Jon Staab
2025-08-22 12:37:19 -07:00
parent eca1ce849b
commit 24ed236a46
+2
View File
@@ -138,6 +138,8 @@ export const socketPolicyCloseInactive = (socket: Socket) => {
// If the socket closed and we have no error, reopen it but don't flap
if (isClosed && pending.size) {
sleep(Math.max(0, ms(5 - (now() - lastOpen)))).then(() => {
socket.attemptToOpen()
for (const message of pending.values()) {
socket.send(message)
}