mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Don'Ãt run message cleanup queries in the API process
This commit is contained in:
parent
1ff86defc3
commit
6cd07ed696
3 changed files with 17 additions and 2 deletions
|
@ -5,6 +5,7 @@ import { QueuedEventEmitter } from "../QueuedEventEmitter";
|
|||
import { GuildChannel, Message } from "eris";
|
||||
import moment from "moment-timezone";
|
||||
import { DAYS, MINUTES } from "../utils";
|
||||
import { isAPI } from "../globals";
|
||||
|
||||
const CLEANUP_INTERVAL = 5 * MINUTES;
|
||||
|
||||
|
@ -39,8 +40,10 @@ async function cleanup() {
|
|||
setTimeout(cleanup, CLEANUP_INTERVAL);
|
||||
}
|
||||
|
||||
// Start first cleanup 30 seconds after startup
|
||||
setTimeout(cleanup, 30 * 1000);
|
||||
if (!isAPI()) {
|
||||
// Start first cleanup 30 seconds after startup
|
||||
setTimeout(cleanup, 30 * 1000);
|
||||
}
|
||||
|
||||
export class GuildSavedMessages extends BaseGuildRepository {
|
||||
private messages: Repository<SavedMessage>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue