use parallelForeach to send ascension inbox message
This commit is contained in:
parent
3165d9f459
commit
4e077e7602
@ -5,6 +5,7 @@ import { config } from "@/src/services/configService";
|
||||
import { createMessage } from "@/src/services/inboxService";
|
||||
import { getInventory } from "@/src/services/inventoryService";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { parallelForeach } from "@/src/utils/async-utils";
|
||||
import { RequestHandler } from "express";
|
||||
import { Types } from "mongoose";
|
||||
|
||||
@ -39,7 +40,7 @@ export const contributeGuildClassController: RequestHandler = async (req, res) =
|
||||
if (!config.fastClanAscension) {
|
||||
// Send message to all active guild members
|
||||
const members = await GuildMember.find({ guildId: payload.GuildId, status: 0 }, "accountId");
|
||||
for (const member of members) {
|
||||
await parallelForeach(members, async member => {
|
||||
// somewhat unfaithful as on live the "msg" is not a loctag, but since we don't have the string, we'll let the client fill it in with "arg".
|
||||
await createMessage(member.accountId, [
|
||||
{
|
||||
@ -49,15 +50,15 @@ export const contributeGuildClassController: RequestHandler = async (req, res) =
|
||||
{
|
||||
Key: "RESETDATE",
|
||||
Tag:
|
||||
guild.CeremonyResetDate.getUTCMonth() +
|
||||
guild.CeremonyResetDate!.getUTCMonth() +
|
||||
"/" +
|
||||
guild.CeremonyResetDate.getUTCDate() +
|
||||
guild.CeremonyResetDate!.getUTCDate() +
|
||||
"/" +
|
||||
(guild.CeremonyResetDate.getUTCFullYear() % 100) +
|
||||
(guild.CeremonyResetDate!.getUTCFullYear() % 100) +
|
||||
" " +
|
||||
guild.CeremonyResetDate.getUTCHours().toString().padStart(2, "0") +
|
||||
guild.CeremonyResetDate!.getUTCHours().toString().padStart(2, "0") +
|
||||
":" +
|
||||
guild.CeremonyResetDate.getUTCMinutes().toString().padStart(2, "0")
|
||||
guild.CeremonyResetDate!.getUTCMinutes().toString().padStart(2, "0")
|
||||
}
|
||||
],
|
||||
sub: "/Lotus/Language/Clan/Clan_AscensionCeremonyInProgress",
|
||||
@ -65,7 +66,7 @@ export const contributeGuildClassController: RequestHandler = async (req, res) =
|
||||
highPriority: true
|
||||
}
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user