debug: improve logging with REQ

This commit is contained in:
Alex Gleason 2023-12-27 22:02:32 -06:00
parent 083496943a
commit 8f07fe8a23
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 2 additions and 2 deletions

View File

@ -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[] = [];

View File

@ -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) {