fetch each author's notes separately

This commit is contained in:
Siddharth Singh 2024-07-02 04:58:06 +05:30
parent 5f0b1ffe79
commit f1e9eb4f4c
No known key found for this signature in database

View file

@ -35,8 +35,11 @@ const importUsers = async (
const matched = [ const matched = [
...await conn.query([{ kinds: [0, 3], authors, limit: 1000 }]), ...await conn.query([{ kinds: [0, 3], authors, limit: 1000 }]),
...(!profilesOnly ? [] : await conn.query([{ kinds: [1], authors, limit: 1000 }])), ...(!profilesOnly ? [] : await conn.query(
authors.map((author) => ({ kinds: [1], authors: [author], limit: 200 })),
)),
]; ];
await conn.close(); await conn.close();
await Promise.all( await Promise.all(
matched.map(async (event) => { matched.map(async (event) => {