Skip to content

Commit 2616526

Browse files
authored
Merge pull request #18 from USTakAssociation/rating-adjustments
fix(ratings): adjust transaction commit order and update API endpoint
2 parents bbd4e9b + 1b57d03 commit 2616526

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

api/src/models/ratings/ratings.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ export class RatingService {
307307
}
308308
}
309309

310+
await gameRunner.commitTransaction();
311+
this.logger.debug('Finished updating games');
310312
// update player query function
311313
async function updatePlayer(rating: number, boost: number, ratedGames, maxRating, ratingAge, fatigueObject, id, participation_rating) {
312314
const updatePlayerQuery = `UPDATE players SET
@@ -366,8 +368,8 @@ export class RatingService {
366368
])
367369
}
368370
}
371+
369372
await playerRunner.commitTransaction();
370-
await gameRunner.commitTransaction();
371373
} catch (error) {
372374
this.logger.error("Error processing player and game ratings, rolling back transaction. ", error);
373375
playerRunner.rollbackTransaction();

api/test/bruno/playtak-api/test-suite/generate.bru

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ meta {
55
}
66

77
get {
8-
url: {{url}}/rating/generate
8+
url: {{url}}/v1/ratings/generate
99
body: none
1010
auth: none
1111
}

0 commit comments

Comments
 (0)