mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-24 18:15:02 +00:00
Centralize archive deletion loop; stagger different centralized loops slightly
This commit is contained in:
parent
1b516b42b8
commit
a573eb3b97
4 changed files with 44 additions and 18 deletions
|
@ -17,7 +17,7 @@ import { RecoverablePluginError } from "./RecoverablePluginError";
|
|||
import { SimpleError } from "./SimpleError";
|
||||
import { ZeppelinGlobalConfig, ZeppelinGuildConfig } from "./types";
|
||||
import { startUptimeCounter } from "./uptime";
|
||||
import { errorMessage, isDiscordAPIError, isDiscordHTTPError, SECONDS, successMessage } from "./utils";
|
||||
import { errorMessage, isDiscordAPIError, isDiscordHTTPError, SECONDS, sleep, successMessage } from "./utils";
|
||||
import { loadYamlSafely } from "./utils/loadYamlSafely";
|
||||
import { DecayingCounter } from "./utils/DecayingCounter";
|
||||
import { PluginNotLoadedError } from "knub/dist/plugins/PluginNotLoadedError";
|
||||
|
@ -28,6 +28,7 @@ import { runUpcomingRemindersLoop } from "./data/loops/upcomingRemindersLoop";
|
|||
import { runUpcomingScheduledPostsLoop } from "./data/loops/upcomingScheduledPostsLoop";
|
||||
import { runExpiringTempbansLoop } from "./data/loops/expiringTempbansLoop";
|
||||
import { runExpiringVCAlertsLoop } from "./data/loops/expiringVCAlertsLoop";
|
||||
import { runExpiredArchiveDeletionLoop } from "./data/loops/expiredArchiveDeletionLoop";
|
||||
|
||||
if (!process.env.KEY) {
|
||||
// tslint:disable-next-line:no-console
|
||||
|
@ -327,12 +328,18 @@ connect().then(async () => {
|
|||
logRateLimit(data);
|
||||
});
|
||||
|
||||
bot.on("loadingFinished", () => {
|
||||
bot.on("loadingFinished", async () => {
|
||||
runExpiringMutesLoop();
|
||||
await sleep(10 * SECONDS);
|
||||
runExpiringTempbansLoop();
|
||||
runExpiringVCAlertsLoop();
|
||||
runUpcomingRemindersLoop();
|
||||
await sleep(10 * SECONDS);
|
||||
runUpcomingScheduledPostsLoop();
|
||||
await sleep(10 * SECONDS);
|
||||
runUpcomingRemindersLoop();
|
||||
await sleep(10 * SECONDS);
|
||||
runExpiringVCAlertsLoop();
|
||||
await sleep(10 * SECONDS);
|
||||
runExpiredArchiveDeletionLoop();
|
||||
});
|
||||
|
||||
bot.initialize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue