summaryrefslogtreecommitdiff
path: root/worker.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-05-28 12:20:24 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-05-28 12:20:24 +0200
commitf997e4dd53886da95c9b7cc98816f7936b89cd0f (patch)
tree63a742a62ffaf7fc47e09a8c3c428d2953b19591 /worker.js
parenta05e70477f930816aa9707b1c09428f8f1a6f2e4 (diff)
downloadprocessor-f997e4dd53886da95c9b7cc98816f7936b89cd0f.tar.gz
processor-f997e4dd53886da95c9b7cc98816f7936b89cd0f.zip
send telemetry notif via header info
Diffstat (limited to 'worker.js')
-rw-r--r--worker.js7
1 files changed, 2 insertions, 5 deletions
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