refactor: simplify resetGameAchievements by replacing Promise.all with a for loop

This commit is contained in:
Hachi-R 2025-01-02 09:35:05 -03:00
parent 52c159fe51
commit e2f798c627

View File

@ -18,11 +18,9 @@ const resetGameAchievements = async (
const achievementFiles = findAchievementFiles(game); const achievementFiles = findAchievementFiles(game);
if (achievementFiles.length) { if (achievementFiles.length) {
await Promise.all( for (const achievementFile of achievementFiles) {
achievementFiles.map(async (achievementFile) => { await fs.promises.rm(achievementFile.filePath);
await fs.promises.rm(achievementFile.filePath, { recursive: true }); }
})
);
} }
await gameAchievementRepository.update( await gameAchievementRepository.update(