logic
logic
DIAdiscord.js - Imagine an app
Created by logic on 12/31/2024 in #djs-questions
`broadcastEval()` fails to return promise, blocking my thread when awaiting it
Okay I thought the behaviour of the function was the same
4 replies
DIAdiscord.js - Imagine an app
Created by logic on 11/18/2024 in #djs-questions
Memory leak when sharding
been a busy week so I haven't actually tested much. but memory usage seems normal now
11 replies
DIAdiscord.js - Imagine an app
Created by logic on 11/18/2024 in #djs-questions
Memory leak when sharding
Im honestly not sure what I did, but it may have solved itself (?)
11 replies
DIAdiscord.js - Imagine an app
Created by logic on 11/18/2024 in #djs-questions
Memory leak when sharding
dev bot without sharding = ~150 mb dev bot with sharding = 490 mb at start and climbs rapidly without stabilizing prod bot without sharding = (cant because its above 2500) prod bot with sharding = 2000 mb at start and climbs without stabilizing
11 replies
DIAdiscord.js - Imagine an app
Created by logic on 11/18/2024 in #djs-questions
Memory leak when sharding
Lmk what other files i should send
11 replies
DIAdiscord.js - Imagine an app
Created by logic on 11/18/2024 in #djs-questions
Memory leak when sharding
Cluster.ts
import { ShardingManager } from "discord.js";
import config from "./models/Config";

const manager = new ShardingManager(`${__dirname}/bot.js`, {
token: config.token,
totalShards: "auto"
});

manager.on('shardCreate', shard => {
console.log(`[SHARD ${shard.id}]: Launched`);
shard.on("ready", async () => {
console.log(`[SHARD ${shard.id}]: Ready`);
});
});

manager.spawn({ timeout: -1 })
.catch(console.error);
import { ShardingManager } from "discord.js";
import config from "./models/Config";

const manager = new ShardingManager(`${__dirname}/bot.js`, {
token: config.token,
totalShards: "auto"
});

manager.on('shardCreate', shard => {
console.log(`[SHARD ${shard.id}]: Launched`);
shard.on("ready", async () => {
console.log(`[SHARD ${shard.id}]: Ready`);
});
});

manager.spawn({ timeout: -1 })
.catch(console.error);
11 replies