db/events: respect the signal
This commit is contained in:
parent
f665c5f825
commit
e341ec7b36
|
@ -257,6 +257,7 @@ async function getEvents<K extends number>(
|
||||||
filters: DittoFilter<K>[],
|
filters: DittoFilter<K>[],
|
||||||
opts: GetEventsOpts = {},
|
opts: GetEventsOpts = {},
|
||||||
): Promise<DittoEvent<K>[]> {
|
): Promise<DittoEvent<K>[]> {
|
||||||
|
if (opts.signal?.aborted) return Promise.resolve([]);
|
||||||
if (!filters.length) return Promise.resolve([]);
|
if (!filters.length) return Promise.resolve([]);
|
||||||
debug('REQ', JSON.stringify(filters));
|
debug('REQ', JSON.stringify(filters));
|
||||||
let query = getEventsQuery(filters);
|
let query = getEventsQuery(filters);
|
||||||
|
|
Loading…
Reference in New Issue