don't hold mutex across net calls
This commit is contained in:
parent
3cfdaacdb3
commit
a5f21922e9
4
honk.go
4
honk.go
|
@ -845,12 +845,14 @@ func gofish(name string) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
handlock.Lock()
|
handlock.Lock()
|
||||||
defer handlock.Unlock()
|
|
||||||
ref, ok := handfull[name]
|
ref, ok := handfull[name]
|
||||||
|
handlock.Unlock()
|
||||||
if ok {
|
if ok {
|
||||||
return ref
|
return ref
|
||||||
}
|
}
|
||||||
j, err := GetJunk(fmt.Sprintf("https://%s/.well-known/webfinger?resource=acct:%s", m[1], name))
|
j, err := GetJunk(fmt.Sprintf("https://%s/.well-known/webfinger?resource=acct:%s", m[1], name))
|
||||||
|
handlock.Lock()
|
||||||
|
defer handlock.Unlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to go fish %s: %s", name, err)
|
log.Printf("failed to go fish %s: %s", name, err)
|
||||||
handfull[name] = ""
|
handfull[name] = ""
|
||||||
|
|
Loading…
Reference in New Issue