From d07cba4c8724841c8d27abefb57e89a495a6ba0b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 17 Mar 2021 19:12:34 +0200 Subject: [PATCH] Reduce asmux pong TTLs --- asmux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/asmux.go b/asmux.go index bdb3bcb..282e0ad 100644 --- a/asmux.go +++ b/asmux.go @@ -57,11 +57,11 @@ type AsmuxPong struct { func (pong *AsmuxPong) fill() { pong.Timestamp = time.Now().Unix() if !pong.OK { - pong.TTL = 300 + pong.TTL = 60 pong.ErrorSource = "bridge" pong.Message = asmuxHumanErrors[pong.Error] } else { - pong.TTL = 1800 + pong.TTL = 240 } } @@ -69,7 +69,7 @@ func (pong *AsmuxPong) shouldDeduplicate(newPong *AsmuxPong) bool { if pong == nil || pong.OK != newPong.OK || pong.Error != newPong.Error { return false } - return pong.Timestamp+int64(pong.TTL/10) > time.Now().Unix() + return pong.Timestamp+int64(pong.TTL/5) > time.Now().Unix() } func (user *User) setupAdminTestHooks() {