except KeyboardInterrupt:
executor.shutdown()
channel.stop_consuming()
+ raise
def remove_file(path):
try:
if len(args) != 0:
raise InvalidArguments()
logging.getLogger().addHandler(printed)
- threaded_consumer(module.QUEUE, module.QUEUE_RESP, functools.partial(do_work, module.extract_text), threads=threads)
+ while True:
+ try:
+ threaded_consumer(module.QUEUE, module.QUEUE_RESP, functools.partial(do_work, module.extract_text), threads=threads)
+ except KeyboardInterrupt:
+ time.sleep(60)
+ break
elif command == "listener":
if len(args) != 0:
raise InvalidArguments()