cron performance improved
This commit is contained in:
@@ -167,7 +167,7 @@ const removePermissionsForBannedUsers = async () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
activePenalties.forEach(async (penalty) => {
|
for (const penalty of activePenalties) {
|
||||||
const user = penalty.User;
|
const user = penalty.User;
|
||||||
|
|
||||||
if (user.DiscordAccount) {
|
if (user.DiscordAccount) {
|
||||||
@@ -178,14 +178,14 @@ const removePermissionsForBannedUsers = async () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
user.FormerDiscordAccounts.forEach(async (formerAccount) => {
|
for (const formerAccount of user.FormerDiscordAccounts) {
|
||||||
await changeMemberRoles(
|
await changeMemberRoles(
|
||||||
formerAccount.discordId,
|
formerAccount.discordId,
|
||||||
[DISCORD_ROLES.PILOT, DISCORD_ROLES.DISPATCHER],
|
[DISCORD_ROLES.PILOT, DISCORD_ROLES.DISPATCHER],
|
||||||
"remove",
|
"remove",
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
});
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cron.schedule("*/5 * * * *", async () => {
|
cron.schedule("*/5 * * * *", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user