Skip to content

Commit e987aa0

Browse files
committed
performance testing
1 parent df34cff commit e987aa0

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

config/config.template.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default {
99
vote_webhook_secret: "",
1010
wolfram_appid: "",
1111
bot_owner_ids: [],
12+
total_shards: /** @type {number | "auto" | undefined} */("auto"),
1213
},
1314
http: {
1415
port: 1335,

src/app.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import fs from "node:fs";
22
import path from "node:path";
3+
import EventEmitter from "node:events";
34
import { ClusterManager } from "discord-hybrid-sharding";
45
import Log from "./util/log.js";
56
import { config, meta } from "../config/config.js";
67
import translationCheck from "./util/translationCheck.js";
78

9+
810
// ========================= //
911
// = Copyright (c) NullDev = //
1012
// ========================= //
1113

14+
EventEmitter.defaultMaxListeners = 20;
15+
1216
const manager = new ClusterManager("./src/bot.js", {
13-
totalShards: "auto",
17+
totalShards: config.discord.total_shards,
1418
shardsPerClusters: 2,
1519
token: config.discord.bot_token,
1620
});

src/bot.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import EventEmitter from "node:events";
12
import { ClusterClient, getInfo } from "discord-hybrid-sharding";
23
import { GatewayIntentBits, Events, ActivityType, Partials } from "discord.js";
34
import Log from "./util/log.js";
@@ -15,6 +16,8 @@ import fastifyHandler from "./service/fastifyHandler.js";
1516
// = Copyright (c) NullDev = //
1617
// ========================= //
1718

19+
EventEmitter.defaultMaxListeners = 20;
20+
1821
const client = new DiscordClient({
1922
intents: [
2023
GatewayIntentBits.Guilds,

0 commit comments

Comments
 (0)