set nil to ch

This commit is contained in:
Yasuhiro Matsumoto
2024-05-24 03:27:55 +09:00
parent 0120ec108a
commit ee54d25940

View File

@@ -110,6 +110,7 @@ func (oss *OpensearchStorage) QueryEvents(ctx context.Context, filter nostr.Filt
ch <- evt
}
close(ch)
ch = nil
} else {
return nil, fmt.Errorf("error getting by id: %w", err)
}
@@ -152,7 +153,9 @@ func (oss *OpensearchStorage) QueryEvents(ctx context.Context, filter nostr.Filt
}
}
}
if ch != nil {
close(ch)
}
}()
return ch, nil