From 049a15612d6a6a6c7de09a751861f2ca0ccfe2dc Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 26 Dec 2019 14:46:37 -0500 Subject: [PATCH] if key fetch fails, save the failure so we don't retry again too quickly --- docs/changelog.txt | 4 ++++ fun.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index 46dbcfa..31fc77f 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -1,5 +1,9 @@ changelog +=== next + ++ Reduce retries talking to dumb servers. + === 0.8.6 Sartorial Headpiece ++ Import command now supports the elephant in the room. diff --git a/fun.go b/fun.go index 35578ba..df275e2 100644 --- a/fun.go +++ b/fun.go @@ -603,6 +603,8 @@ var zaggies = cache.New(cache.Options{Filler: func(keyname string) (*rsa.PublicK j, err := GetJunk(keyname) if err != nil { log.Printf("error getting %s pubkey: %s", keyname, err) + when := time.Now().UTC().Format(dbtimeformat) + stmtSaveXonker.Exec(keyname, "failed", "pubkey", when) return nil, true } allinjest(originate(keyname), j) @@ -610,6 +612,8 @@ var zaggies = cache.New(cache.Options{Filler: func(keyname string) (*rsa.PublicK err = row.Scan(&data) if err != nil { log.Printf("key not found after ingesting") + when := time.Now().UTC().Format(dbtimeformat) + stmtSaveXonker.Exec(keyname, "failed", "pubkey", when) return nil, true } }