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( const [additionalData, previousScore] = await Promise.all([
this.getAdditionalScoreData(
score.playerId, score.playerId,
leaderboard.songHash, leaderboard.songHash,
`${leaderboard.difficulty.difficulty}-${leaderboard.difficulty.characteristic}`, `${leaderboard.difficulty.difficulty}-${leaderboard.difficulty.characteristic}`,
score.score score.score
); ),
this.getPreviousScore(score.playerId, leaderboard.id + "", score.timestamp),
]);
if (additionalData) { if (additionalData) {
score.additionalData = additionalData; score.additionalData = additionalData;
} }
const previousScore = await this.getPreviousScore(score.playerId, leaderboard.id + "", score.timestamp);
if (previousScore) { if (previousScore) {
score.previousScore = previousScore; score.previousScore = previousScore;
} }