summaryrefslogtreecommitdiff
path: root/worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'worker.js')
-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