mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-24 18:15:02 +00:00
Centralize periodic checks for mutes, tempbans, vcalerts, reminders, and scheduled posts
This should result in a significant performance improvement. The new method is also more precise than the old one, allowing the aforementioned checks to be performed with second-precision.
This commit is contained in:
parent
544363058e
commit
076d69b989
55 changed files with 883 additions and 366 deletions
|
@ -23,6 +23,11 @@ import { DecayingCounter } from "./utils/DecayingCounter";
|
|||
import { PluginNotLoadedError } from "knub/dist/plugins/PluginNotLoadedError";
|
||||
import { logRestCall } from "./restCallStats";
|
||||
import { logRateLimit } from "./rateLimitStats";
|
||||
import { runExpiringMutesLoop } from "./data/loops/expiringMutesLoop";
|
||||
import { runUpcomingRemindersLoop } from "./data/loops/upcomingRemindersLoop";
|
||||
import { runUpcomingScheduledPostsLoop } from "./data/loops/upcomingScheduledPostsLoop";
|
||||
import { runExpiringTempbansLoop } from "./data/loops/expiringTempbansLoop";
|
||||
import { runExpiringVCAlertsLoop } from "./data/loops/expiringVCAlertsLoop";
|
||||
|
||||
if (!process.env.KEY) {
|
||||
// tslint:disable-next-line:no-console
|
||||
|
@ -322,6 +327,14 @@ connect().then(async () => {
|
|||
logRateLimit(data);
|
||||
});
|
||||
|
||||
bot.on("loadingFinished", () => {
|
||||
runExpiringMutesLoop();
|
||||
runExpiringTempbansLoop();
|
||||
runExpiringVCAlertsLoop();
|
||||
runUpcomingRemindersLoop();
|
||||
runUpcomingScheduledPostsLoop();
|
||||
});
|
||||
|
||||
bot.initialize();
|
||||
logger.info("Bot Initialized");
|
||||
logger.info("Logging in...");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue