Skip to content

Commit

Permalink
fix: sleep call with kwitt
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik K committed Jan 2, 2024
1 parent c996126 commit be73957
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ClusterManager, ReClusterManager, HeartbeatManager } from "discord-hybr

const manager = new ClusterManager(`${__dirname}/index.js`, {
shardsPerClusters: 10,
totalShards: 9,
mode: "process",
token: process.env.TOKEN,
});
Expand Down
9 changes: 4 additions & 5 deletions src/util/dailyMessage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EmbedBuilder, bold } from "discord.js";
import * as mom from "moment-timezone";
import { white, gray, green } from "chalk-advanced";
import * as mom from "moment-timezone";
import { CronJob } from "cron";
import { captureException } from "@sentry/node";
import WouldYou from "./wouldYou";
Expand All @@ -19,9 +19,9 @@ export default class DailyMessage {
start() {
new CronJob(
"0 */30 * * * *", // Every 30 minutes, every hour, every day
async () => {
await this.runSchedule();
},
(() => {
this.runSchedule();
}),
null,
true,
"Europe/Berlin",
Expand All @@ -44,7 +44,6 @@ export default class DailyMessage {
"Running daily message check for " + guilds.length + " guilds",
)}`,
);

let i = 0;
for (const db of guilds) {
if (!db?.dailyChannel) continue;
Expand Down
9 changes: 4 additions & 5 deletions src/util/wouldYou.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,10 @@ export default class WouldYou extends Client {
this.keepAlive = new KeepAlive(this);
this.keepAlive.start();

if (this.cluster.id === 0) {
// Daily Message
this.dailyMessage = new DailyMessage(this);
this.dailyMessage.start();
}
// Daily Message
this.dailyMessage = new DailyMessage(this);
this.dailyMessage.start();


this.voting = new Voting(this);
this.voting.start();
Expand Down

0 comments on commit be73957

Please sign in to comment.