mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-02-23 10:51:22 +02:00
fix(stats): should have retested that...
This commit is contained in:
parent
6b0146e099
commit
c185afcdfe
@ -39,16 +39,14 @@ async function sendToHouston(client) {
|
|||||||
activated_users: users._count,
|
activated_users: users._count,
|
||||||
arch: process.arch,
|
arch: process.arch,
|
||||||
database: process.env.DB_PROVIDER,
|
database: process.env.DB_PROVIDER,
|
||||||
guilds: await Promise.all(
|
guilds: await relativePool(0.25, 'stats', async pool => Promise.all(
|
||||||
await relativePool(0.25, 'stats', pool =>
|
|
||||||
guilds
|
guilds
|
||||||
.filter(guild => client.guilds.cache.has(guild.id))
|
.filter(guild => client.guilds.cache.has(guild.id))
|
||||||
.map(async guild => {
|
.map(async guild => {
|
||||||
guild.members = client.guilds.cache.get(guild.id).memberCount;
|
guild.members = client.guilds.cache.get(guild.id).memberCount;
|
||||||
return pool.queue(w => w.aggregateGuildForHouston(guild, messages));
|
return pool.queue(w => w.aggregateGuildForHouston(guild, messages));
|
||||||
}),
|
}),
|
||||||
),
|
)),
|
||||||
),
|
|
||||||
id: md5(client.user.id),
|
id: md5(client.user.id),
|
||||||
node: process.version,
|
node: process.version,
|
||||||
os: process.platform,
|
os: process.platform,
|
||||||
|
@ -18,8 +18,7 @@ async function pool(size, name, fun) {
|
|||||||
try {
|
try {
|
||||||
return await fun(pool);
|
return await fun(pool);
|
||||||
} finally {
|
} finally {
|
||||||
await pool.settled();
|
pool.settled().then(() => pool.terminate());
|
||||||
await pool.terminate();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -35,7 +34,7 @@ async function quick(name, fun) {
|
|||||||
// ! this await is extremely important
|
// ! this await is extremely important
|
||||||
return await fun(thread);
|
return await fun(thread);
|
||||||
} finally {
|
} finally {
|
||||||
await Thread.terminate(thread);
|
Thread.terminate(thread);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user