Răsfoiți Sursa

Reduce asmux pong TTLs

Tulir Asokan 4 ani în urmă
părinte
comite
d07cba4c87
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      asmux.go

+ 3 - 3
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() {