summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-08-23 19:27:23 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-08-23 19:27:23 +0200
commit658ed4fb8c557898e62d2b849e39f0d0c5cc7294 (patch)
tree1c76bd06ec4b450e9129a69691989f33c9f2ab5a
parent637da9ecd45fa431fe4371c9e6c4839da51701d3 (diff)
downloadanalyzer-658ed4fb8c557898e62d2b849e39f0d0c5cc7294.tar.gz
analyzer-658ed4fb8c557898e62d2b849e39f0d0c5cc7294.zip
change auto send to player crunch queue to global crunch queue
-rw-r--r--worker.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/worker.py b/worker.py
index a25873d..3a87af6 100644
--- a/worker.py
+++ b/worker.py
@@ -22,7 +22,7 @@ CHUNKSIZE = int(os.environ.get("CHUNKSIZE") or 100) # matches
IDLE_TIMEOUT = float(os.environ.get("IDLE_TIMEOUT") or 1) # s
QUEUE = os.environ.get("QUEUE") or "analyze"
DOCRUNCHMATCH = os.environ.get("DOCRUNCHMATCH") == "true"
-CRUNCH_PLAYER_QUEUE = os.environ.get("CRUNCH_PLAYER_QUEUE") or "crunch_player"
+CRUNCH_QUEUE = os.environ.get("CRUNCH_QUEUE") or "crunch_global"
DOTELESUCKMATCH = os.environ.get("DOTELESUCKMATCH") == "true"
TELESUCK_QUEUE = os.environ.get("TELESUCK_QUEUE") or "telesuck"
UNKNOWN_PLAYER_SIGMA = int(os.environ.get("UNKNOWN_PLAYER_SIGMA")) or 500
@@ -101,7 +101,7 @@ def connect():
channel = rabbit.channel()
channel.queue_declare(queue=QUEUE, durable=True)
channel.queue_declare(queue=QUEUE + "_failed", durable=True)
- channel.queue_declare(queue=CRUNCH_PLAYER_QUEUE, durable=True)
+ channel.queue_declare(queue=CRUNCH_QUEUE, durable=True)
channel.queue_declare(queue=TELESUCK_QUEUE, durable=True)
channel.basic_qos(prefetch_count=BATCHSIZE)
channel.basic_consume(newjob, queue=QUEUE)
@@ -139,10 +139,9 @@ def try_process():
for meth, prop, body in queue:
channel.basic_ack(meth.delivery_tag)
if DOCRUNCHMATCH:
- # TODO adds match api ids
- # forward to cruncher
+ # forward to cruncher_global
channel.basic_publish(exchange="",
- routing_key=CRUNCH_PLAYER_QUEUE,
+ routing_key=CRUNCH_QUEUE,
body=body,
properties=prop)
if DOTELESUCKMATCH: