use listener instead of rabittmq
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user