fix: log summoner puuid when riot match endpoint returns a 404

This commit is contained in:
Valentin Kaelin 2020-07-23 23:47:03 +02:00
parent 16a8f2503a
commit abab481f8d

View file

@ -110,19 +110,15 @@ class MatchService {
/* If we have to store some matches in the db */
if (matchesFromApi.length !== 0) {
const ctx = {
account,
}
// Try to see why matches are sometimes undefined
matchesFromApi.filter(m => {
if (m === undefined) {
Logger.transport('file').info('Match undefined', matchesToGetFromRiot)
Logger.transport('file').info(`Match undefined, summoner: ${summonerDB.puuid}`, m)
}
})
// Transform raw matches data
await BasicMatchTransformer.transform(matchesFromApi, ctx)
await BasicMatchTransformer.transform(matchesFromApi, { account })
/* Save all matches from Riot Api in db */
for (const match of matchesFromApi) {