add some optimization
Some checks failed
Deploy Backend / docker (ubuntu-latest) (push) Failing after 32s

This commit is contained in:
Lee 2024-10-29 18:48:09 +00:00
parent 069a566d40
commit 78c8c1ba98

@ -363,17 +363,18 @@ export class ScoreService {
};
}
const additionalData = await ScoreService.getAdditionalScoreData(
score.playerId,
leaderboard.songHash,
`${leaderboard.difficulty.difficulty}-${leaderboard.difficulty.characteristic}`,
score.score
);
const [additionalData, previousScore] = await Promise.all([
this.getAdditionalScoreData(
score.playerId,
leaderboard.songHash,
`${leaderboard.difficulty.difficulty}-${leaderboard.difficulty.characteristic}`,
score.score
),
this.getPreviousScore(score.playerId, leaderboard.id + "", score.timestamp),
]);
if (additionalData) {
score.additionalData = additionalData;
}
const previousScore = await this.getPreviousScore(score.playerId, leaderboard.id + "", score.timestamp);
if (previousScore) {
score.previousScore = previousScore;
}