cron performance improved

This commit is contained in:
PxlLoewe
2026-01-06 03:08:16 +01:00
parent 0ac943c63f
commit dd39331c1a

View File

@@ -167,7 +167,7 @@ const removePermissionsForBannedUsers = async () => {
},
});
activePenalties.forEach(async (penalty) => {
for (const penalty of activePenalties) {
const user = penalty.User;
if (user.DiscordAccount) {
@@ -178,14 +178,14 @@ const removePermissionsForBannedUsers = async () => {
);
}
user.FormerDiscordAccounts.forEach(async (formerAccount) => {
for (const formerAccount of user.FormerDiscordAccounts) {
await changeMemberRoles(
formerAccount.discordId,
[DISCORD_ROLES.PILOT, DISCORD_ROLES.DISPATCHER],
"remove",
);
});
});
}
}
};
cron.schedule("*/5 * * * *", async () => {