Debug upgrade

dev-linux
Ivan Maslov 4 years ago
parent 22c4cae9ba
commit 8f056e024e

@ -1,4 +1,4 @@
import requests, time import requests, time, json
# O2A - Data flow Orchestrator to Agent # O2A - Data flow Orchestrator to Agent
# f"{lProtocolStr}://{lHostStr}:{lPortInt}/pyOpenRPA/Agent/O2A" # f"{lProtocolStr}://{lHostStr}:{lPortInt}/pyOpenRPA/Agent/O2A"
@ -19,6 +19,7 @@ def O2A_Loop(inGSettings):
lActivityLastGUIDStr = "" # Init empty ActivityLastGUIDStr lActivityLastGUIDStr = "" # Init empty ActivityLastGUIDStr
while inGSettings["O2ADict"]["IsOnlineBool"]: while inGSettings["O2ADict"]["IsOnlineBool"]:
# Send request to the orchestrator server # Send request to the orchestrator server
lRequestBody = None
try: try:
lProtocolStr= "https" if inGSettings["OrchestratorDict"]["IsHTTPSBool"] else "http" lProtocolStr= "https" if inGSettings["OrchestratorDict"]["IsHTTPSBool"] else "http"
lHostStr = inGSettings["OrchestratorDict"]["HostStr"] lHostStr = inGSettings["OrchestratorDict"]["HostStr"]
@ -30,6 +31,7 @@ def O2A_Loop(inGSettings):
if lL: lL.warning(f"Agent can not connect to Orchestrator. Below the response from the orchestrator:{lResponse}") if lL: lL.warning(f"Agent can not connect to Orchestrator. Below the response from the orchestrator:{lResponse}")
time.sleep(inGSettings["O2ADict"]["RetryTimeoutSecFloat"]) time.sleep(inGSettings["O2ADict"]["RetryTimeoutSecFloat"])
else: else:
lRequestBody = lResponse.text
lQueueItem = lResponse.json() # Try to get JSON lQueueItem = lResponse.json() # Try to get JSON
# Append QUEUE item in ProcessorDict > ActivityList # Append QUEUE item in ProcessorDict > ActivityList
lActivityLastGUIDStr = lQueueItem["GUIDStr"] lActivityLastGUIDStr = lQueueItem["GUIDStr"]
@ -44,3 +46,7 @@ def O2A_Loop(inGSettings):
except ConnectionResetError as e: except ConnectionResetError as e:
if lL: lL.error(f"O2A Connection error - orchestrator is not available. Sleep for {inGSettings['A2ODict']['RetryTimeoutSecFloat']} s.") if lL: lL.error(f"O2A Connection error - orchestrator is not available. Sleep for {inGSettings['A2ODict']['RetryTimeoutSecFloat']} s.")
time.sleep(inGSettings["O2ADict"]["RetryTimeoutSecFloat"]) time.sleep(inGSettings["O2ADict"]["RetryTimeoutSecFloat"])
except json.decoder.JSONDecodeError as e:
if lL: lL.error(
f"See body of the recieved content from the Orchestrator: {lRequestBody}")
time.sleep(inGSettings["O2ADict"]["RetryTimeoutSecFloat"])
Loading…
Cancel
Save