Skip to content

Commit 40d5fff

Browse files
committed
do update set
1 parent 18cf6eb commit 40d5fff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

svc/rater.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function doRate() {
5050
const newRating = oldRating + delta;
5151
console.log('account_id: %s, oldRating: %s, newRating: %s, delta: %s', p.account_id, oldRating, newRating, delta);
5252
// Write ratings back to players
53-
await db.raw('UPDATE player_computed_mmr SET computed_mmr = ? WHERE account_id = ?', [newRating, p.account_id]);
53+
await db.raw('INSERT INTO player_computed_mmr(account_id, computed_mmr) VALUES(?, ?) ON CONFLICT DO UPDATE SET computed_mmr = EXCLUDED.computed_mmr', [newRating, p.account_id]);
5454
}
5555
// Delete row
5656
await db.raw('DELETE FROM rating_queue WHERE id = ?', row.id);

0 commit comments

Comments
 (0)