Commit 6ab4946b authored by 神楽坂玲奈's avatar 神楽坂玲奈

timeout 2

parent caf5d277
Pipeline #16126 passed with stages
in 43 seconds
{ {
"port": 500, "port": 500,
"timeout": 20, "timeout": 10,
"timeout2": 100,
"interval": 1000, "interval": 1000,
"throttle": 10 "throttle": 10
} }
...@@ -68,7 +68,8 @@ export class Router { ...@@ -68,7 +68,8 @@ export class Router {
update(socket: Socket) { update(socket: Socket) {
if (!this.rinfo) return; if (!this.rinfo) return;
if (Date.now() - this.time > config.timeout * 1000) { const timeout = Router.updating?.router == this ? config.timeout : config.timeout2;
if (Date.now() - this.time > timeout * config.interval) {
console.log(`router ${this.id} lost connection.`); console.log(`router ${this.id} lost connection.`);
this.rinfo = undefined; this.rinfo = undefined;
this.reset(); this.reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment