From 4f1225ae48c4348dadfd2e77de52122baf680c87 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 20 May 2022 23:31:18 -0400 Subject: [PATCH] clarify logging --- fun.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fun.go b/fun.go index 6132025..d46d1c0 100644 --- a/fun.go +++ b/fun.go @@ -635,14 +635,13 @@ func ziggy(userid int64) *KeyInfo { 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,9 +649,13 @@ var zaggies = cache.New(cache.Options{Filler: func(keyname string) (httpsig.Publ 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 { ilog.Printf("error decoding %s pubkey: %s", keyname, err)