Skip to content

Commit f223b09

Browse files
committed
Update calculateMMR.ts
1 parent bef491e commit f223b09

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/utils/algorithms/calculateMMR.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import {
2-
getQueueSettings,
3-
getMatchData,
4-
getWinningTeamFromMatch,
5-
updatePlayerMmrAll,
6-
} from '../queryDB'
7-
import type { Matches, Settings, teamResults } from 'psqlDB'
1+
import { getQueueSettings, updatePlayerMmrAll } from '../queryDB'
2+
import type { Matches, Queues, teamResults } from 'psqlDB'
83
import { setUserQueueRole } from 'utils/queueHelpers'
94
import { clamp } from 'lodash-es'
105

@@ -132,11 +127,10 @@ export async function calculatePredictedMMR(
132127
export async function calculateNewMMR(
133128
queueId: number,
134129
matchData: Matches,
135-
queueSettings: Settings,
130+
queueSettings: Queues,
136131
teamResults: teamResults,
137132
winningTeamId: number,
138133
): Promise<teamResults> {
139-
140134
try {
141135
const { teamStats, ratingChange, loserCount } =
142136
await calculateTeamStatsAndChanges(
@@ -166,11 +160,9 @@ export async function calculateNewMMR(
166160

167161
// Collect database update promises to run in parallel
168162
updatePromises.push(
169-
updatePlayerMmrAll(queueId, player.user_id, newMMR, newVolatility)
170-
)
171-
updatePromises.push(
172-
setUserQueueRole(queueId, player.user_id)
163+
updatePlayerMmrAll(queueId, player.user_id, newMMR, newVolatility),
173164
)
165+
updatePromises.push(setUserQueueRole(queueId, player.user_id))
174166
}
175167

176168
// Set team score

0 commit comments

Comments
 (0)