all repos — honk @ cc8ca896594db957b6888b285c33d44fc8da0cdd

my fork of honk

clarify logging
Ted Unangst tedu@tedunangst.com
Fri, 20 May 2022 23:31:18 -0400
commit

cc8ca896594db957b6888b285c33d44fc8da0cdd

parent

8a01b26d77b4022a9d339d5fd2ae74a43b196d69

1 files changed, 6 insertions(+), 3 deletions(-)

jump to
M fun.gofun.go

@@ -635,14 +635,13 @@

var zaggies = cache.New(cache.Options{Filler: func(keyname string) (httpsig.PublicKey, bool) { data := getxonker(keyname, "pubkey") if data == "" { - var key httpsig.PublicKey dlog.Printf("hitting the webs for missing pubkey: %s", keyname) j, err := GetJunk(serverUID, keyname) if err != nil { ilog.Printf("error getting %s pubkey: %s", keyname, err) when := time.Now().UTC().Format(dbtimeformat) stmtSaveXonker.Exec(keyname, "failed", "pubkey", when) - return key, true + return httpsig.PublicKey{}, true } allinjest(originate(keyname), j) data = getxonker(keyname, "pubkey")

@@ -650,8 +649,12 @@ if data == "" {

ilog.Printf("key not found after ingesting") when := time.Now().UTC().Format(dbtimeformat) stmtSaveXonker.Exec(keyname, "failed", "pubkey", when) - return key, true + return httpsig.PublicKey{}, true } + } + if data == "failed" { + ilog.Printf("lookup previously failed key %s", keyname) + return httpsig.PublicKey{}, true } _, key, err := httpsig.DecodeKey(data) if err != nil {