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);
if (achievementFiles.length) {
await Promise.all(
achievementFiles.map(async (achievementFile) => {
await fs.promises.rm(achievementFile.filePath, { recursive: true });
})
);
for (const achievementFile of achievementFiles) {
await fs.promises.rm(achievementFile.filePath);
}
}
await gameAchievementRepository.update(