Commit 6d4340aa authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

No loop

parent 88a79f4d
......@@ -200,33 +200,31 @@ if __name__ == "__main__":
logger.info("Connected to %s : %s", AMQP_SERVER, connection)
try:
while True:
# wait for message on queue
logger.info(
"waiting for incoming message on queue %s ~~~~~~~~~~~~ ", queue
)
message = receiver.receive(timeout=None)
logger.info("message received : %s", message)
# launch subsequent action
if isinstance(message.body, bytes):
m = message.body.decode('utf-8')
else:
m = message.body
if args.validated_data_integrated_files:
validated_data_integrated_files(m)
if args.seedtree:
seedtree(m)
if args.wfcatalog:
wfcatalog(m)
receiver.accept()
logger.info("message acknowledged")
# wait for message on queue
logger.info(
"waiting for incoming message on queue %s ~~~~~~~~~~~~ ", queue
)
message = receiver.receive(timeout=None)
logger.info("message received : %s", message)
# launch subsequent action
if isinstance(message.body, bytes):
m = message.body.decode('utf-8')
else:
m = message.body
if args.validated_data_integrated_files:
validated_data_integrated_files(m)
if args.seedtree:
seedtree(m)
if args.wfcatalog:
wfcatalog(m)
receiver.accept()
logger.info("message acknowledged")
except Exception as err:
logger.critical(traceback.format_exc())
logger.critical(str(err))
raise
finally:
connection.close()
logger.info("amqp worker quitting")
connection.close()
logger.info("amqp worker quitting")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment