mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-17 21:32:55 +01:00
ensure AddEvent contexts get cleaned so store queries aren't left half-read.
similar to 1196fabb86
This commit is contained in:
parent
6d827ac89a
commit
18fc0dc1dd
@ -11,6 +11,9 @@ import (
|
||||
|
||||
// AddEvent sends an event through then normal add pipeline, as if it was received from a websocket.
|
||||
func (rl *Relay) AddEvent(ctx context.Context, evt *nostr.Event) (skipBroadcast bool, writeError error) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
if evt == nil {
|
||||
return false, errors.New("error: event is nil")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user