mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-03 19:49:46 +02:00
namedLock() uses normalized uri and a simple test.
This commit is contained in:
parent
b00bf363c8
commit
0836352724
2
go.mod
2
go.mod
@ -6,7 +6,6 @@ require (
|
|||||||
github.com/bluekeyes/go-gitdiff v0.7.1
|
github.com/bluekeyes/go-gitdiff v0.7.1
|
||||||
github.com/btcsuite/btcd/btcec/v2 v2.3.2
|
github.com/btcsuite/btcd/btcec/v2 v2.3.2
|
||||||
github.com/btcsuite/btcd/btcutil v1.1.3
|
github.com/btcsuite/btcd/btcutil v1.1.3
|
||||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
|
|
||||||
github.com/gobwas/httphead v0.1.0
|
github.com/gobwas/httphead v0.1.0
|
||||||
github.com/gobwas/ws v1.2.0
|
github.com/gobwas/ws v1.2.0
|
||||||
github.com/mailru/easyjson v0.7.7
|
github.com/mailru/easyjson v0.7.7
|
||||||
@ -27,6 +26,7 @@ require (
|
|||||||
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect
|
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
|
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
|
||||||
|
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
|
||||||
github.com/gobwas/pool v0.2.1 // indirect
|
github.com/gobwas/pool v0.2.1 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
|
14
helpers_test.go
Normal file
14
helpers_test.go
Normal file
File diff suppressed because one or more lines are too long
3
pool.go
3
pool.go
@ -74,8 +74,7 @@ var _ PoolOption = (WithAuthHandler)(nil)
|
|||||||
|
|
||||||
func (pool *SimplePool) EnsureRelay(url string) (*Relay, error) {
|
func (pool *SimplePool) EnsureRelay(url string) (*Relay, error) {
|
||||||
nm := NormalizeURL(url)
|
nm := NormalizeURL(url)
|
||||||
|
defer namedLock(nm)()
|
||||||
defer namedLock(url)()
|
|
||||||
|
|
||||||
relay, ok := pool.Relays.Load(nm)
|
relay, ok := pool.Relays.Load(nm)
|
||||||
if ok && relay.IsConnected() {
|
if ok && relay.IsConnected() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user