bouncer: rework relay abandon func

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle 2024-02-18 19:42:45 +07:00
parent b4eab0d2f4
commit f00e449036

View File

@ -327,7 +327,7 @@ function newConn(addr, client, reconn_t = 0) {
if (client.readyState !== 1) return;
client.relays.delete(relay);
if (res.statusCode >= 500) return relay.emit("close", null);
delete relays[relays.indexOf(addr)];
relays = relays.filter(_ => !relay.url.startsWith(_));
console.log(process.pid, "-!-", `${relay.url} give status code ${res.statusCode}. Not (re)connect with new session again.`);
});