️ Change keepDataUpToDate to 00:00 on 1 of month

This commit is contained in:
Axel Olausson Holtenäs 2022-06-30 12:47:27 +02:00
parent 88c6740adc
commit 21365d5ecf
No known key found for this signature in database
GPG key ID: 7BF6826B76382CBA

View file

@ -6,7 +6,7 @@ import fetchGuild from "../../helpers/fetchGuild";
import guildSchema from "../../models/guild"; import guildSchema from "../../models/guild";
export const options = { export const options = {
schedule: "*/5 * * * * *", // https://crontab.guru/ schedule: "0 0 1 * *", // https://crontab.guru/
}; };
export const execute = async (client: Client) => { export const execute = async (client: Client) => {
@ -21,17 +21,14 @@ export const execute = async (client: Client) => {
.filter((x) => !guildsDB.some((y) => y.guildId === x.id)) .filter((x) => !guildsDB.some((y) => y.guildId === x.id))
.map((z) => z.id); .map((z) => z.id);
logger.silly(shouldNotExist);
logger.silly(shouldExist);
if (shouldNotExist) { if (shouldNotExist) {
shouldNotExist.map(async (x) => { shouldNotExist.forEach(async (x) => {
await dropGuild(x); await dropGuild(x);
}); });
} }
if (shouldExist) { if (shouldExist) {
shouldExist.map(async (x) => { shouldExist.forEach(async (x) => {
await fetchGuild(x); await fetchGuild(x);
}); });
} }