From 12cee1f36c885faefe29fd138846c08138650c7a Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Mon, 12 Apr 2021 18:57:23 +0300 Subject: [PATCH] Debug upgrade --- Sources/pyOpenRPA/Agent/O2A.py | 9 ++++----- Sources/pyOpenRPA/Orchestrator/ServerSettings.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Sources/pyOpenRPA/Agent/O2A.py b/Sources/pyOpenRPA/Agent/O2A.py index d3ed4153..38b92316 100644 --- a/Sources/pyOpenRPA/Agent/O2A.py +++ b/Sources/pyOpenRPA/Agent/O2A.py @@ -37,9 +37,6 @@ def O2A_Loop(inGSettings): lActivityLastGUIDStr = lQueueItem["GUIDStr"] inGSettings["ProcessorDict"]["ActivityList"].append(lQueueItem) if lL: lL.debug(f"ActivityItem was received from orchestrator: {lQueueItem}"); - except Exception as e: - if lL: lL.exception(f"O2A Error handler. Sleep for {inGSettings['A2ODict']['RetryTimeoutSecFloat']} s.") - time.sleep(inGSettings["O2ADict"]["RetryTimeoutSecFloat"]) except requests.exceptions.ConnectionError as e: if lL: lL.error(f"O2A Connection error - orchestrator is not available. Sleep for {inGSettings['A2ODict']['RetryTimeoutSecFloat']} s.") time.sleep(inGSettings["O2ADict"]["RetryTimeoutSecFloat"]) @@ -47,6 +44,8 @@ def O2A_Loop(inGSettings): if lL: lL.error(f"O2A Connection error - orchestrator is not available. Sleep for {inGSettings['A2ODict']['RetryTimeoutSecFloat']} s.") 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}") + if lL: lL.error(f"See body of the recieved content from the Orchestrator: {lRequestBody}") + time.sleep(inGSettings["O2ADict"]["RetryTimeoutSecFloat"]) + except Exception as e: + if lL: lL.exception(f"O2A Error handler. Sleep for {inGSettings['A2ODict']['RetryTimeoutSecFloat']} s.") time.sleep(inGSettings["O2ADict"]["RetryTimeoutSecFloat"]) \ No newline at end of file diff --git a/Sources/pyOpenRPA/Orchestrator/ServerSettings.py b/Sources/pyOpenRPA/Orchestrator/ServerSettings.py index 6610118c..fd629a97 100644 --- a/Sources/pyOpenRPA/Orchestrator/ServerSettings.py +++ b/Sources/pyOpenRPA/Orchestrator/ServerSettings.py @@ -393,7 +393,7 @@ def pyOpenRPA_Agent_O2A(inRequest, inGSettings): else: # no queue item - sleep for the next iteration time.sleep(1) except Exception as e: - pass + if lL: lL.exception("pyOpenRPA_Agent_O2A Exception!") lThisAgentDict["ConnectionCountInt"] -= 1 # Connection go to be closed - decrement the connection count # See docs in Agent (pyOpenRPA.Agent.A2O) def pyOpenRPA_Agent_A2O(inRequest, inGSettings):