diff --git a/apps/core-server/modules/chron.ts b/apps/core-server/modules/chron.ts index 32c66ee0..6e8e5f37 100644 --- a/apps/core-server/modules/chron.ts +++ b/apps/core-server/modules/chron.ts @@ -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 () => {