summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-07-26 21:26:07 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-07-26 21:26:07 +0200
commit9e3c593ca9e37e81ea40616ef50ffcb3fcb4810f (patch)
tree556f755de95c95e4c117402e954544b1714ba96d
parent7b851abb845b43ec1ed72422872e130c14624aa0 (diff)
downloadcruncher-9e3c593ca9e37e81ea40616ef50ffcb3fcb4810f.tar.gz
cruncher-9e3c593ca9e37e81ea40616ef50ffcb3fcb4810f.zip
go into slowmode before processing
-rw-r--r--worker.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/worker.js b/worker.js
index f303be0..4071af5 100644
--- a/worker.js
+++ b/worker.js
@@ -93,6 +93,11 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => {
participants.clear();
+ if (SLOWMODE > 0) {
+ logger.info("slowmode active, sleeping…", { wait: SLOWMODE });
+ await sleep(SLOWMODE * 1000);
+ }
+
try {
await crunch(api_ids);
} catch (err) {
@@ -113,11 +118,6 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => {
// TODO notify for player too
// TODO fix these
await ch.publish("amq.topic", "global", new Buffer("points_update"));
-
- if (SLOWMODE > 0) {
- logger.info("slowmode active, sleeping…", { wait: SLOWMODE });
- await sleep(SLOWMODE * 1000);
- }
}
// execute the script