diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-12-21 21:03:56 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-12-21 21:03:56 +0100 |
| commit | 5ab44eeca78f2feecbae553650c16ef8cedc35dc (patch) | |
| tree | 4da7d2023838c58a9c027d1775d57dfd09a7cca1 | |
| parent | a27449646b8660399b42d1a5448d788de2b3123e (diff) | |
| download | processor-5ab44eeca78f2feecbae553650c16ef8cedc35dc.tar.gz processor-5ab44eeca78f2feecbae553650c16ef8cedc35dc.zip | |
map match names for not casual/ranked
| -rw-r--r-- | worker.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -374,6 +374,10 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => { let match = JSON.parse(JSON.stringify(msg.content)); // deep clone match.id = uuidfy(match.id); match.created_at = new Date(Date.parse(match.created_at)); + if (!api_name_mappings.has(match.game_mode)) { + throw `API mappings is missing game mode ${match.game_mode}, affected match: ${match.shard_id}/${match.id}`; + } + match.game_mode = api_name_mappings.get(match.game_mode); // TODO db col is only 16 bytes, some modes are 33 chars -> map to shorter name // flatten jsonapi nested response into our db structure-like shape // also, push missing fields |
