summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-07-24 13:16:07 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-07-24 13:16:07 +0200
commitce37668d805443571987ef06d12907b401bb395a (patch)
tree231342e95c44c75f97946898a0cfbdf138faa5c5
parentcf0b811538144fb0838566f6d0eff2eaf505b673 (diff)
downloadanalyzer-ce37668d805443571987ef06d12907b401bb395a.tar.gz
analyzer-ce37668d805443571987ef06d12907b401bb395a.zip
fix float&decimals, fix error handling
-rw-r--r--worker.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/worker.py b/worker.py
index 187d86e..80600bc 100644
--- a/worker.py
+++ b/worker.py
@@ -114,12 +114,16 @@ def try_process():
timer = None
try:
process()
- except e:
+ except Exception as e:
logging.error(e)
- for q in queue:
+ for meth, prop, body in queue:
# move to error queue and NACK
- channel.basic_publish("", QUEUE + "_failed", q[1], q[2])
- channel.basic_nack(q[0].delivery_tag, requeue=False)
+ print(prop)
+ channel.basic_publish(exchange="",
+ routing_key=QUEUE+"_failed",
+ body=body,
+ properties=prop)
+ channel.basic_nack(meth.delivery_tag, requeue=False)
queue = []
return
@@ -204,7 +208,7 @@ def process():
# match hasn't been rated before
player.trueskill_mu = rating.mu
player.trueskill_sigma = rating.sigma
- participant.trueskill_delta = (participant.mu - participant.sigma) - (float(player.trueskill_mu) - float(player.trueskill_sigma))
+ participant.trueskill_delta = (float(participant.trueskill_mu) - float(participant.trueskill_sigma)) - (float(player.trueskill_mu) - float(player.trueskill_sigma))
db.commit()
# notify web