def _done_cb(channel, method, future):
# Always executed on main thread
response = future.result()
- if response is not None:
+ if response is not None and response_queue is not None:
with lib.timer("send-response 1/2", logging.warning):
channel.basic_publish(
exchange='',
logging.error("skipped {}".format(output_path))
else:
content = base64.b64decode(response["content"].encode('ascii'))
- with open(output_file, "wb") as f:
+ with open(output_path, "wb") as f:
f.write(content)
logging.warning("saved {}".format(output_path))
elif command == "listener":
if len(args) != 0:
raise InvalidArguments()
- threaded_consumer(module.QUEUE_RESP, do_listen, threads=threads)
+ threaded_consumer(module.QUEUE_RESP, None, do_listen, threads=threads)
elif command == "enqueue":
if len(args) != 0:
raise InvalidArguments()
- enqueue_all(queue, module.generate_tasks())
+ enqueue_all(module.QUEUE, module.generate_tasks())
elif command == "debug":
if len(args) != 2:
raise InvalidArguments()