diff --git a/src/lib/stats.js b/src/lib/stats.js index d12bb99..fc7b98b 100644 --- a/src/lib/stats.js +++ b/src/lib/stats.js @@ -39,16 +39,14 @@ async function sendToHouston(client) { activated_users: users._count, arch: process.arch, database: process.env.DB_PROVIDER, - guilds: await Promise.all( - await relativePool(0.25, 'stats', pool => - guilds - .filter(guild => client.guilds.cache.has(guild.id)) - .map(async guild => { - guild.members = client.guilds.cache.get(guild.id).memberCount; - return pool.queue(w => w.aggregateGuildForHouston(guild, messages)); - }), - ), - ), + guilds: await relativePool(0.25, 'stats', async pool => Promise.all( + guilds + .filter(guild => client.guilds.cache.has(guild.id)) + .map(async guild => { + guild.members = client.guilds.cache.get(guild.id).memberCount; + return pool.queue(w => w.aggregateGuildForHouston(guild, messages)); + }), + )), id: md5(client.user.id), node: process.version, os: process.platform, diff --git a/src/lib/threads.js b/src/lib/threads.js index d351ad7..9a17dd5 100644 --- a/src/lib/threads.js +++ b/src/lib/threads.js @@ -18,8 +18,7 @@ async function pool(size, name, fun) { try { return await fun(pool); } finally { - await pool.settled(); - await pool.terminate(); + pool.settled().then(() => pool.terminate()); } }; @@ -35,7 +34,7 @@ async function quick(name, fun) { // ! this await is extremely important return await fun(thread); } finally { - await Thread.terminate(thread); + Thread.terminate(thread); } };