From f997e4dd53886da95c9b7cc98816f7936b89cd0f Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 28 May 2017 12:20:24 +0200 Subject: send telemetry notif via header info --- worker.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'worker.js') diff --git a/worker.js b/worker.js index 50c50d5..3f0c717 100644 --- a/worker.js +++ b/worker.js @@ -696,7 +696,6 @@ function flatten(obj) { transaction_profiler.done("database transaction"); // notify web - // …about new matches await Promise.map(msgs, async (m) => { if (m.properties.headers.notify == undefined) return; let notif = "error"; @@ -704,6 +703,8 @@ function flatten(obj) { if (m.properties.type == "match") notif = "matches_update"; // player obj updated if (m.properties.type == "player") notif = "stats_update"; + // new phases + if (m.properties.type == "telemetry") notif = "phases_update"; await ch.publish("amq.topic", m.properties.headers.notify, new Buffer(notif)); @@ -711,10 +712,6 @@ function flatten(obj) { // …global about new matches if (match_records.length > 0) await ch.publish("amq.topic", "global", new Buffer("matches_update")); - // …about new phases - await Promise.map(telemetry_objects, async (t) => - await ch.publish("amq.topic", "match." + t.match_api_id, - new Buffer("phases_update")) ); } // Split participant API data into participant and participant_stats -- cgit v1.3.1