summaryrefslogtreecommitdiff
path: root/worker.js
diff options
context:
space:
mode:
authorKapil Viren Ahuja <k.v.ahuja@gmail.com>2017-03-30 21:34:58 +0530
committerKapil Viren Ahuja <k.v.ahuja@gmail.com>2017-03-30 21:34:58 +0530
commit37c16ecf9fd64fc7644e82d8619584d0f64d694e (patch)
treedfa3cdcef7294f17687d476415658d5adee16e97 /worker.js
parent4e4597e14f5a4a70c6e81ec431946abbafe7ceb2 (diff)
downloadprocessor-37c16ecf9fd64fc7644e82d8619584d0f64d694e.tar.gz
processor-37c16ecf9fd64fc7644e82d8619584d0f64d694e.zip
Pushed shard_id to all the tables as shard + api_id is the unique combination
Diffstat (limited to 'worker.js')
-rw-r--r--worker.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/worker.js b/worker.js
index a563562..3c51624 100644
--- a/worker.js
+++ b/worker.js
@@ -60,13 +60,18 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost",
await match.rosters.forEach(async (roster) => {
roster.match_api_id = match.api_id;
+ roster.shard_id = match.shard_id;
await model.Roster.upsert(roster, {
include: [ model.Participant/*, model.Team*/ ]
});
await roster.participants.forEach(async (participant) => {
+ participant.shard_id = roster.shard_id;
+ participant.player.shard_id = participant.shard_id;
+
await model.Player.upsert(participant.player);
+
participant.roster_api_id = roster.api_id;
participant.player_api_id = participant.player.api_id;
await model.Participant.upsert(participant, {