Explorar o código

Reduce asmux pong TTLs

Tulir Asokan %!s(int64=4) %!d(string=hai) anos
pai
achega
d07cba4c87
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  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() {