use listener instead of rabittmq

This commit is contained in:
2022-03-24 10:57:57 +01:00
parent d0d3d59f27
commit 13a17e3d79
2 changed files with 18 additions and 9 deletions
+13 -1
View File
@@ -151,6 +151,18 @@ def on_message_received(ch, method, properties, body):
is_finished = True
def on_success(result: ReserveResultPojo):
logger.info("on_success called.")
result.sim_position = current_sim_position
result.slot_position = current_card_pool_slot
logger.info(result)
firebase_store_manager.save(result)
oracle_log_sender.send_appoint_result(result)
# set the flag to True
global is_finished
is_finished = True
def start_listen():
logger.info("start to listen to message queue")
receiver = MessageReceiver()
@@ -206,7 +218,7 @@ def start_book():
"password": params.PROXY_PASSWORD
}
commandor.start_page(proxy=proxy, contact=modem.contact,
on_ready_for_otp=on_ready_for_otp)
on_ready_for_otp=on_ready_for_otp, on_sucess=on_success)
start_to_handle_sms(modem)
except Exception as error:
print(error)