namedLock() uses normalized uri and a simple test.

This commit is contained in:
fiatjaf
2024-05-29 08:39:24 -03:00
parent b00bf363c8
commit 0836352724
3 changed files with 16 additions and 3 deletions

View File

@@ -74,8 +74,7 @@ var _ PoolOption = (WithAuthHandler)(nil)
func (pool *SimplePool) EnsureRelay(url string) (*Relay, error) {
nm := NormalizeURL(url)
defer namedLock(url)()
defer namedLock(nm)()
relay, ok := pool.Relays.Load(nm)
if ok && relay.IsConnected() {