parallelise
All checks were successful
Build / build (pull_request) Successful in 1m8s

This commit is contained in:
2025-11-13 09:18:45 +01:00
parent 0733fdf407
commit fd04055a4e

View File

@@ -7,8 +7,7 @@ import { getInventory } from "../../services/inventoryService.ts";
export const unlockAllScansController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const stats = await getStats(accountId);
const inventory = await getInventory(accountId, "ChallengeProgress");
const [stats, inventory] = await Promise.all([getStats(accountId), getInventory(accountId, "ChallengeProgress")]);
const scanTypes = new Set<string>(allScans);
for (const type of Object.keys(ExportEnemies.avatars)) {
@@ -31,7 +30,6 @@ export const unlockAllScansController: RequestHandler = async (req, res) => {
});
}
await stats.save();
await inventory.save();
await Promise.all([stats.save(), inventory.save()]);
res.end();
};