async fix done!

dev-fastapi
Иван Маслов 2 years ago
parent d58008833b
commit b1e6932180

@ -155,7 +155,6 @@ async def pyOpenRPA_ServerData(inRequest: Request, inAuthTokenStr:str=Depends(Id
# Generate hash # Generate hash
lServerDataHashStr = str(hash(lServerDataDictJSONStr)) lServerDataHashStr = str(hash(lServerDataDictJSONStr))
if lValueStr!=lServerDataHashStr and lServerDataHashStr!= "" and lServerDataHashStr!= None: # Case if Hash is not equal if lValueStr!=lServerDataHashStr and lServerDataHashStr!= "" and lServerDataHashStr!= None: # Case if Hash is not equal
print(f"lValueStr:{lValueStr}, lServerDataHashStr:{lServerDataHashStr}")
lFlagDoGenerateBool = False lFlagDoGenerateBool = False
else: # Case Hashes are equal else: # Case Hashes are equal
await asyncio.sleep(inGSettings["Client"]["Session"]["ControlPanelRefreshIntervalSecFloat"]) await asyncio.sleep(inGSettings["Client"]["Session"]["ControlPanelRefreshIntervalSecFloat"])
@ -330,7 +329,7 @@ def pyOpenRPA_ActivityListExecute(inRequest:Request, inAuthTokenStr:str = Depend
# See docs in Agent (pyOpenRPA.Agent.O2A) # See docs in Agent (pyOpenRPA.Agent.O2A)
@app.post(path="/orpa/agent/o2a",response_class=JSONResponse,tags=["Agent"]) @app.post(path="/orpa/agent/o2a",response_class=JSONResponse,tags=["Agent"])
def pyOpenRPA_Agent_O2A(inRequest:Request, inAuthTokenStr:str = Depends(IdentifyAuthorize), inBodyDict = Body({})): async def pyOpenRPA_Agent_O2A(inRequest:Request, inAuthTokenStr:str = Depends(IdentifyAuthorize), inBodyDict = Body({})):
inGSettings = __Orchestrator__.GSettingsGet() inGSettings = __Orchestrator__.GSettingsGet()
lL = __Orchestrator__.OrchestratorLoggerGet() lL = __Orchestrator__.OrchestratorLoggerGet()
lConnectionLifetimeSecFloat = inGSettings["ServerDict"]["AgentConnectionLifetimeSecFloat"] # 300.0 # 5 min * 60 sec 300.0 lConnectionLifetimeSecFloat = inGSettings["ServerDict"]["AgentConnectionLifetimeSecFloat"] # 300.0 # 5 min * 60 sec 300.0
@ -398,9 +397,9 @@ def pyOpenRPA_Agent_O2A(inRequest:Request, inAuthTokenStr:str = Depends(Identify
lThisAgentDict["ConnectionCountInt"] -= 1 # Connection go to be closed - decrement the connection count lThisAgentDict["ConnectionCountInt"] -= 1 # Connection go to be closed - decrement the connection count
return lReturnActivityItemList return lReturnActivityItemList
else: # Nothing to send - sleep for the next iteration else: # Nothing to send - sleep for the next iteration
time.sleep(lAgentLoopSleepSecFloat) await asyncio.sleep(lAgentLoopSleepSecFloat)
else: # no queue item - sleep for the next iteration else: # no queue item - sleep for the next iteration
time.sleep(lAgentLoopSleepSecFloat) await asyncio.sleep(lAgentLoopSleepSecFloat)
except Exception as e: except Exception as e:
if lL: lL.exception("pyOpenRPA_Agent_O2A Exception!") if lL: lL.exception("pyOpenRPA_Agent_O2A Exception!")
lThisAgentDict["ConnectionCountInt"] -= 1 # Connection go to be closed - decrement the connection count lThisAgentDict["ConnectionCountInt"] -= 1 # Connection go to be closed - decrement the connection count

Loading…
Cancel
Save