mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 16:30:08 +00:00
10 lines
335 B
TypeScript
10 lines
335 B
TypeScript
/** Handler used to determine max number of shards to use based upon the max concurrency. */
|
|
export function calculateMaxShards(maxShards: number, maxConcurrency: number): number {
|
|
if (maxShards < 100) return maxShards;
|
|
|
|
return Math.ceil(
|
|
maxShards /
|
|
(maxConcurrency === 1 ? 16 : maxConcurrency),
|
|
) * maxConcurrency;
|
|
}
|