|
|
|
@ -10,17 +10,16 @@ import requests, time
|
|
|
|
|
# Send logs to orchestrator
|
|
|
|
|
def _A2ODataSend(inGSettings, inDataDict):
|
|
|
|
|
lL = inGSettings["Logger"]
|
|
|
|
|
while inGSettings["A2O"]["IsOnlineBool"]:
|
|
|
|
|
# Send request to the orchestrator server
|
|
|
|
|
try:
|
|
|
|
|
lProtocolStr= "https" if inGSettings["OrchestratorDict"]["IsHTTPSBool"] else "http"
|
|
|
|
|
lHostStr = inGSettings["OrchestratorDict"]["HostStr"]
|
|
|
|
|
lPortInt = inGSettings["OrchestratorDict"]["PortInt"]
|
|
|
|
|
lURLStr=f"{lProtocolStr}://{lHostStr}:{lPortInt}/pyOpenRPA/Agent/A2O"
|
|
|
|
|
lResponse = requests.post(url= lURLStr, cookies = {"AuthToken":inGSettings["OrchestratorDict"]["SuperTokenStr"]}, data=inDataDict)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
if lL: lL.exception(f"A2O Error handler. Sleep for {inGSettings['A2O']['RetryTimeoutSecFloat']} s.")
|
|
|
|
|
time.sleep(inGSettings["A2O"]["RetryTimeoutSecFloat"])
|
|
|
|
|
# Send request to the orchestrator server
|
|
|
|
|
try:
|
|
|
|
|
lProtocolStr= "https" if inGSettings["OrchestratorDict"]["IsHTTPSBool"] else "http"
|
|
|
|
|
lHostStr = inGSettings["OrchestratorDict"]["HostStr"]
|
|
|
|
|
lPortInt = inGSettings["OrchestratorDict"]["PortInt"]
|
|
|
|
|
lURLStr=f"{lProtocolStr}://{lHostStr}:{lPortInt}/pyOpenRPA/Agent/A2O"
|
|
|
|
|
lResponse = requests.post(url= lURLStr, cookies = {"AuthToken":inGSettings["OrchestratorDict"]["SuperTokenStr"]}, json=inDataDict)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
if lL: lL.exception(f"A2O Error handler.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Send some logs to orchestrator
|
|
|
|
|
def LogListSend(inGSettings, inLogList):
|
|
|
|
|