mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-27 20:38:41 +02:00
use context passed to .Connect() for the live of the relay.
This commit is contained in:
2
relay.go
2
relay.go
@@ -73,7 +73,7 @@ func (r *Relay) String() string {
|
||||
// Once successfully connected, context expiration has no effect: call r.Close
|
||||
// to close the connection.
|
||||
func (r *Relay) Connect(ctx context.Context) error {
|
||||
connectionContext, cancel := context.WithCancel(context.Background())
|
||||
connectionContext, cancel := context.WithCancel(ctx)
|
||||
r.ConnectionContext = connectionContext
|
||||
|
||||
if r.URL == "" {
|
||||
|
Reference in New Issue
Block a user