fix(socketio): Re-try thrice before trying to reconnect
Set reconnectionAttempts to 3. If the server doesn't want to connect with the respective client (invalid origin, no cookie or sid transmitted) or is gone down, socketio client would retry connections indefinitely. This change limits retrying connection to just thrice every second.
This commit is contained in:
parent
c86e1de38a
commit
5210ea593f
1 changed files with 3 additions and 0 deletions
|
|
@ -17,14 +17,17 @@ frappe.socketio = {
|
|||
frappe.socketio.socket = io.connect(frappe.socketio.get_host(port), {
|
||||
secure: true,
|
||||
withCredentials: true,
|
||||
reconnectionAttempts: 3,
|
||||
});
|
||||
} else if (window.location.protocol == "http:") {
|
||||
frappe.socketio.socket = io.connect(frappe.socketio.get_host(port), {
|
||||
withCredentials: true,
|
||||
reconnectionAttempts: 3,
|
||||
});
|
||||
} else if (window.location.protocol == "file:") {
|
||||
frappe.socketio.socket = io.connect(window.localStorage.server, {
|
||||
withCredentials: true,
|
||||
reconnectionAttempts: 3,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue