mirror of
https://github.com/Yonle/bostr.git
synced 2025-10-10 16:42:34 +02:00
worker: do not reconnect to cache relays/loadbalancer bouncers if status code ix 4xx
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
@@ -446,7 +446,9 @@ function newConn(addr, id, reconn_t = 0) {
|
|||||||
if (!userRelays.hasOwnProperty(id)) return;
|
if (!userRelays.hasOwnProperty(id)) return;
|
||||||
userRelays[id].delete(relay);
|
userRelays[id].delete(relay);
|
||||||
if (res.statusCode >= 500) return relay.emit("close", null);
|
if (res.statusCode >= 500) return relay.emit("close", null);
|
||||||
relays = relays.filter(_ => _ != addr);
|
delete relays[relays.indexOf(addr)];
|
||||||
|
delete cache_relays[cache_relays.indexOf(addr)];
|
||||||
|
delete loadbalancer[loadbalancer.indexOf(addr)];
|
||||||
console.log(threadId, "-!-", `${addr} give status code ${res.statusCode}. Not (re)connect with new session again.`);
|
console.log(threadId, "-!-", `${addr} give status code ${res.statusCode}. Not (re)connect with new session again.`);
|
||||||
|
|
||||||
stats._global.f++
|
stats._global.f++
|
||||||
|
Reference in New Issue
Block a user