Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Framework/install_handler/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
import asyncio
import platform
from Framework.Utilities import RequestFormatter, ConfigModule, CommonUtil
from Framework.Utilities import RequestFormatter, CommonUtil

debug = False
version = "2.0.0"
Expand Down Expand Up @@ -40,6 +40,8 @@ def generate_services_list(services):


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

for _ in range(3):
try:
resp = await RequestFormatter.request("post", host, json=data, timeout=70)
resp = await asyncio.to_thread(RequestFormatter.request, "post", host, json=data, timeout=70)
if debug:
print(f"[installer] Response status: {resp.status_code}")
print(f"[installer] Response content: {resp.content}")
if not resp.ok:
if debug:
print(f"[installer] Failed to send response: {resp.status_code}")
await asyncio.sleep(3,5)
await asyncio.sleep(3.5)
else:
break
except Exception as e:
if debug: print(e)
await asyncio.sleep(3,5)
if debug:
print(e)
await asyncio.sleep(3.5)
except Exception as e:
print(f"[installer] Error sending response: {e}")
print(f"[installer] Error sending response: {e}")
Loading
Loading