fix(stats): should have retested that...

This commit is contained in:
Isaac 2025-02-12 01:44:56 +00:00
parent 6b0146e099
commit c185afcdfe
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33
2 changed files with 10 additions and 13 deletions

View File

@ -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: 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,

View File

@ -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);
}
};