From e0a0fb60c862e6f520812d308728eb3cdf428420 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Mon, 23 Feb 2015 20:41:28 +0100 Subject: [PATCH] =?UTF-8?q?param=C3=A9trise=20la=20QUEUE=20c=C3=B4t=C3=A9?= =?UTF-8?q?=20serveur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py.example | 2 ++ daemon.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.py.example b/config.py.example index 4de3e8e..5b2b3a2 100644 --- a/config.py.example +++ b/config.py.example @@ -7,3 +7,5 @@ PARAMS = pika.ConnectionParameters(host='rabbitmq.crans.org', port=5671, credentials=CREDS, ssl=True) DEVICE = "/dev/ttyAMA0" #Ou USB0 sur oie + +QUEUE = 'CransTicket' # ou 'CransTicketDebug' en test diff --git a/daemon.py b/daemon.py index df84579..7ca7860 100755 --- a/daemon.py +++ b/daemon.py @@ -12,12 +12,12 @@ import config def run(): conn = pika.BlockingConnection(config.PARAMS) ch = conn.channel() - ch.queue_declare(queue='CransTicketDebug') + ch.queue_declare(queue=config.QUEUE) def callback(ch, method, properties, body): print (" [x] Received %r" % (body,)) dump.print_liste(json.loads(body)) - ch.basic_consume(callback, queue='CransTicketDebug', no_ack=True) + ch.basic_consume(callback, queue=config.QUEUE, no_ack=True) ch.start_consuming() conn.close() # fork en arrière plan + pidfile