all repos — honk @ 61991f1a0233c5577b67b1eba29596870221ee06

my fork of honk

for fatal error (no such host), advance the retry clock
Ted Unangst tedu@tedunangst.com
Tue, 13 Jun 2023 13:56:42 -0400
commit

61991f1a0233c5577b67b1eba29596870221ee06

parent

b816ce1f91e0633e47ba93cc890a629ce4c2951b

1 files changed, 12 insertions(+), 0 deletions(-)

jump to
M deliverator.godeliverator.go

@@ -19,6 +19,7 @@ import (

"bytes" "database/sql" notrand "math/rand" + "strings" "sync" "time"

@@ -58,6 +59,14 @@ select {

case pokechan <- 0: default: } +} + +func lethaldose(err error) int64 { + str := err.Error() + if strings.Contains(str, "no such host") { + return 8 + } + return 0 } var dqmtx sync.Mutex

@@ -132,6 +141,9 @@ }

err := PostMsg(ki.keyname, ki.seckey, inbox, msg) if err != nil { ilog.Printf("failed to post json to %s: %s", inbox, err) + if t := lethaldose(err); t > doover.Tries { + doover.Tries = t + } doover.Msgs = doover.Msgs[i:] sayitagain(doover) return