fix socket cleanup timeout system
This commit is contained in:
@@ -1313,14 +1313,16 @@ async function cleanupSocket(socket) {
|
|||||||
// set timer to destroy entirety of session data if client does not return in X time
|
// set timer to destroy entirety of session data if client does not return in X time
|
||||||
var timeout = 180000; // timeout is in milliseconds, default 180000 (3 min) .. be sure to allow time for dialup reconnections
|
var timeout = 180000; // timeout is in milliseconds, default 180000 (3 min) .. be sure to allow time for dialup reconnections
|
||||||
|
|
||||||
if (!ssid_sessions[socket.ssid].data_store.socket_check) {
|
// clear any existing timeout check
|
||||||
ssid_sessions[socket.ssid].data_store.socket_check = setTimeout(function (ssid) {
|
if (ssid_sessions[socket.ssid].data_store.socket_check) clearTimeout(ssid_sessions[socket.ssid].data_store.socket_check);
|
||||||
if (ssid_sessions[ssid].currentConnections() === 0) {
|
|
||||||
if (!zquiet) console.log(" * WebTV SSID", filterSSID(ssid), " has not been seen in", (timeout / 1000), "seconds, cleaning up session data for this SSID");
|
// set timeout to check
|
||||||
delete ssid_sessions[ssid];
|
ssid_sessions[socket.ssid].data_store.socket_check = setTimeout(function (ssid) {
|
||||||
}
|
if (ssid_sessions[ssid].currentConnections() === 0) {
|
||||||
}, timeout, socket.ssid);
|
if (!zquiet) console.log(" * WebTV SSID", filterSSID(ssid), " has not been seen in", (timeout / 1000), "seconds, cleaning up session data for this SSID");
|
||||||
}
|
delete ssid_sessions[ssid];
|
||||||
|
}
|
||||||
|
}, timeout, socket.ssid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
socket.end();
|
socket.end();
|
||||||
|
|||||||
Reference in New Issue
Block a user