From dd39331c1a58d51881487f88c43a45140322f837 Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Tue, 6 Jan 2026 03:08:16 +0100 Subject: [PATCH] cron performance improved --- apps/core-server/modules/chron.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 () => {