From 5ab44eeca78f2feecbae553650c16ef8cedc35dc Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 21 Dec 2017 21:03:56 +0100 Subject: map match names for not casual/ranked --- worker.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'worker.js') 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 -- cgit v1.3.1