all repos — honk @ 94ad2503130114c75b25fce7bb74aa05659898d1

my fork of honk

better handle lookup that doesn't keep hammering failures
Ted Unangst tedu@tedunangst.com
Thu, 15 Aug 2019 23:38:01 -0400
commit

94ad2503130114c75b25fce7bb74aa05659898d1

parent

2d48a59984723cb4480a013b05eef3a79f3cd428

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

jump to
M fun.gofun.go

@@ -379,15 +379,23 @@ func handles(xid string) (string, string) {

row := stmtGetXonker.QueryRow(xid, "handle") var handle string err := row.Scan(&handle) - if err == nil { - return handle, handle + "@" + originate(xid) + if err != nil { + p := investigate(xid) + if p == nil { + m := re_unurl.FindStringSubmatch(xid) + if len(m) > 2 { + handle = m[2] + } else { + handle = xid + } + } else { + handle = p.Handle + } + stmtSaveXonker.Exec(xid, handle, "handle") } - p := investigate(xid) - if p == nil { + if handle == xid { return xid, xid } - handle = p.Handle - stmtSaveXonker.Exec(xid, handle, "handle") return handle, handle + "@" + originate(xid) }