diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-06-21 15:18:27 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-06-21 15:18:27 +0200 |
| commit | 0b45709b0fd5973dd85d53089c8c3f2f3abf60e0 (patch) | |
| tree | c27fcfdc396e6537151133a51579f8b6ced2f2e0 | |
| parent | fb3d4a57d67420648c11e7ab82b15d19cf719fac (diff) | |
| download | analyzer-0b45709b0fd5973dd85d53089c8c3f2f3abf60e0.tar.gz analyzer-0b45709b0fd5973dd85d53089c8c3f2f3abf60e0.zip | |
support dynamic queue namesrelease/2.8.0
| -rw-r--r-- | worker.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -17,6 +17,7 @@ DATABASE_URI = os.environ["DATABASE_URI"] BATCHSIZE = int(os.environ.get("BATCHSIZE") or 500) # matches 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" # mapping from Tier (-1 - 30) to average skill tier points vst_points = { @@ -105,9 +106,9 @@ def connect(): logging.error(err) time.sleep(5) channel = rabbit.channel() - channel.queue_declare(queue="analyze", durable=True) + channel.queue_declare(queue=QUEUE, durable=True) channel.basic_qos(prefetch_count=BATCHSIZE) - channel.basic_consume(newjob, queue="analyze") + channel.basic_consume(newjob, queue=QUEUE) def newjob(_, method, properties, body): |
