From 2daa402ad60726bb11b368883b7ddefa02dceee9 Mon Sep 17 00:00:00 2001 From: Kasherpete <119694008+Kasherpete@users.noreply.github.com> Date: Tue, 3 Oct 2023 21:34:13 -0500 Subject: [PATCH] Increase timeout to 30s --- sms_registration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sms_registration.py b/sms_registration.py index 8e7208a..a8d3e6b 100644 --- a/sms_registration.py +++ b/sms_registration.py @@ -16,7 +16,7 @@ def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str, """Forwards a registration request to the phone and returns the phone number, signature for the provided push token""" if gateway is None: print("Requesting device MCC+MNC for gateway detection...") - mccmnc = requests.get(f"http://{PHONE_IP}:{API_PORT}/info").text + mccmnc = requests.get(f"http://{PHONE_IP}:{API_PORT}/info", timeout=30).text print("MCC+MNC received! " + mccmnc) print("Determining gateway...") gateway = gateway_fetch.getGatewayMCCMNC(mccmnc) @@ -30,7 +30,7 @@ def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str, req_id = random.randint(0, 2**32) sms = f"REG-REQ?v=3;t={token};r={req_id};" print("Sending message and waiting for response...") - r = requests.get(f"http://{PHONE_IP}:{API_PORT}/register", params={"sms": sms, "gateway": gateway}, timeout=16) + r = requests.get(f"http://{PHONE_IP}:{API_PORT}/register", params={"sms": sms, "gateway": gateway}, timeout=30) print("Received response from device!") if no_parse: print("Now do the next part and rerun with --pdu")