summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-12-21 21:03:56 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-12-21 21:03:56 +0100
commit5ab44eeca78f2feecbae553650c16ef8cedc35dc (patch)
tree4da7d2023838c58a9c027d1775d57dfd09a7cca1
parenta27449646b8660399b42d1a5448d788de2b3123e (diff)
downloadprocessor-5ab44eeca78f2feecbae553650c16ef8cedc35dc.tar.gz
processor-5ab44eeca78f2feecbae553650c16ef8cedc35dc.zip
map match names for not casual/ranked
-rw-r--r--worker.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/worker.js b/worker.js
index 799e731..ed0bf10 100644
--- a/worker.js
+++ b/worker.js
@@ -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