better handle lookup that doesn't keep hammering failures
This commit is contained in:
parent
617cdd5fd8
commit
8886e78b8c
20
fun.go
20
fun.go
|
@ -379,15 +379,23 @@ func handles(xid string) (string, string) {
|
||||||
row := stmtGetXonker.QueryRow(xid, "handle")
|
row := stmtGetXonker.QueryRow(xid, "handle")
|
||||||
var handle string
|
var handle string
|
||||||
err := row.Scan(&handle)
|
err := row.Scan(&handle)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
return handle, handle + "@" + originate(xid)
|
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 handle == xid {
|
||||||
if p == nil {
|
|
||||||
return xid, xid
|
return xid, xid
|
||||||
}
|
}
|
||||||
handle = p.Handle
|
|
||||||
stmtSaveXonker.Exec(xid, handle, "handle")
|
|
||||||
return handle, handle + "@" + originate(xid)
|
return handle, handle + "@" + originate(xid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue