summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-05-30 10:41:41 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-05-30 10:41:41 +0200
commit1fa04d0c589e400d616c7e4e00b86a04f930cc82 (patch)
tree7aead4f74fb019e5dfe22b30b5be6654be7e2f06
parent53a4a0d89571783b58b16d5cb76d69cdb4587f00 (diff)
downloadcruncher-1fa04d0c589e400d616c7e4e00b86a04f930cc82.tar.gz
cruncher-1fa04d0c589e400d616c7e4e00b86a04f930cc82.zip
send notification before sleeping
-rw-r--r--worker.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/worker.js b/worker.js
index edf777e..cabac95 100644
--- a/worker.js
+++ b/worker.js
@@ -139,15 +139,16 @@ if (LOGGLY_TOKEN)
type: seq.QueryTypes.UPSERT
});
+ // notify web
+ // TODO notify for player too
+ await ch.publish("amq.topic", "global", new Buffer("points_update"));
+
if (SLOWMODE > 0) {
logger.info("slowmode active, sleeping…", { wait: SLOWMODE });
await sleep(SLOWMODE * 1000);
}
// ack
await Promise.map(msgs, async (m) => await ch.ack(m));
- // notify web
- // TODO notify for player too
- await ch.publish("amq.topic", "global", new Buffer("points_update"));
profiler.done("crunched", { size: msgs.size });
}