mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-27 17:24:19 +01:00
debug: improve logging with REQ
This commit is contained in:
@@ -10,7 +10,7 @@ const debug = Debug('ditto:client');
|
||||
function getFilters<K extends number>(filters: Filter<K>[], opts: GetFiltersOpts = {}): Promise<Event<K>[]> {
|
||||
if (opts.signal?.aborted) return Promise.resolve([]);
|
||||
if (!filters.length) return Promise.resolve([]);
|
||||
debug(JSON.stringify(filters));
|
||||
debug('REQ', JSON.stringify(filters));
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const results: Event[] = [];
|
||||
|
||||
@@ -58,7 +58,7 @@ class Reqmeister extends EventEmitter<{ [filterId: string]: (event: Event) => an
|
||||
if (wantedAuthors.size) filters.push({ kinds: [0], authors: [...wantedAuthors] });
|
||||
|
||||
if (filters.length) {
|
||||
debug(JSON.stringify(filters));
|
||||
debug('REQ', JSON.stringify(filters));
|
||||
const events = await client.getFilters(filters, { signal: AbortSignal.timeout(timeout) });
|
||||
|
||||
for (const event of events) {
|
||||
|
||||
Reference in New Issue
Block a user