From 9e3c593ca9e37e81ea40616ef50ffcb3fcb4810f Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 26 Jul 2017 21:26:07 +0200 Subject: go into slowmode before processing --- worker.js | 10 +++++----- 1 file 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 -- cgit v1.3.1