Skip to content

Commit 7ad568d

Browse files
authored
Install Android and Web dependency locally (#661)
* Updated integrated installer for android to use localhost * Revert android_sdk and emulator update style to original * Added web post request made asynchronous to improve performance
1 parent e30b364 commit 7ad568d

3 files changed

Lines changed: 642 additions & 6 deletions

File tree

Framework/install_handler/utils.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import datetime
22
import asyncio
33
import platform
4-
from Framework.Utilities import RequestFormatter, ConfigModule, CommonUtil
4+
from Framework.Utilities import RequestFormatter, CommonUtil
55

66
debug = False
77
version = "2.0.0"
@@ -40,6 +40,8 @@ def generate_services_list(services):
4040

4141

4242
async def send_response(data=None) -> None:
43+
if data is None:
44+
data = {}
4345
try:
4446
from Framework.install_handler.route import services
4547
host = RequestFormatter.form_uri("d/nodes/install/server/push")
@@ -60,18 +62,19 @@ async def send_response(data=None) -> None:
6062

6163
for _ in range(3):
6264
try:
63-
resp = await RequestFormatter.request("post", host, json=data, timeout=70)
65+
resp = await asyncio.to_thread(RequestFormatter.request, "post", host, json=data, timeout=70)
6466
if debug:
6567
print(f"[installer] Response status: {resp.status_code}")
6668
print(f"[installer] Response content: {resp.content}")
6769
if not resp.ok:
6870
if debug:
6971
print(f"[installer] Failed to send response: {resp.status_code}")
70-
await asyncio.sleep(3,5)
72+
await asyncio.sleep(3.5)
7173
else:
7274
break
7375
except Exception as e:
74-
if debug: print(e)
75-
await asyncio.sleep(3,5)
76+
if debug:
77+
print(e)
78+
await asyncio.sleep(3.5)
7679
except Exception as e:
77-
print(f"[installer] Error sending response: {e}")
80+
print(f"[installer] Error sending response: {e}")

0 commit comments

Comments
 (0)