|
|
|
@ -243,17 +243,17 @@ def pyOpenRPA_Agent_O2A(inRequest, inGSettings):
|
|
|
|
|
if lL: lL.debug(f'O2A BEFORE: ConnectionCountInt: {lThisAgentDict["ConnectionCountInt"]};ConnectionFirstQueueItemCountInt {lThisAgentDict["ConnectionFirstQueueItemCountInt"]}')
|
|
|
|
|
if lThisAgentDict["ConnectionCountInt"] == lThisAgentDict["ConnectionFirstQueueItemCountInt"] + 1:
|
|
|
|
|
# POP QUEUE ITEM CONDITION ConnectionCountInt == ConnectionFirstQueueItemCountInt + 1
|
|
|
|
|
lQueueItem = lThisAgentDict["ActivityList"].pop(0)
|
|
|
|
|
lActivityItem = lThisAgentDict["ActivityList"].pop(0)
|
|
|
|
|
lThisAgentDict["ConnectionFirstQueueItemCountInt"] = 0
|
|
|
|
|
if lL: lL.debug(f"Activity was deleted from the list: {lThisAgentDict['ActivityList']}")
|
|
|
|
|
else:
|
|
|
|
|
lQueueItem = lThisAgentDict["ActivityList"][0]
|
|
|
|
|
lActivityItem = lThisAgentDict["ActivityList"][0]
|
|
|
|
|
lThisAgentDict["ConnectionFirstQueueItemCountInt"] += 1
|
|
|
|
|
if lL: lL.debug(f"Activity was !not! deleted from the list: {lThisAgentDict['ActivityList']}")
|
|
|
|
|
if lL: lL.debug(f'O2A AFTER: ConnectionCountInt: {lThisAgentDict["ConnectionCountInt"]};ConnectionFirstQueueItemCountInt {lThisAgentDict["ConnectionFirstQueueItemCountInt"]}')
|
|
|
|
|
# Send QUEUE ITEM
|
|
|
|
|
if lL: lL.debug(f"Activity item to agent: {lQueueItem}")
|
|
|
|
|
inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lQueueItem), "utf8")
|
|
|
|
|
if lL: lL.info(f"Activity item to agent Hostname {lInput['HostNameUpperStr']}, User {lInput['UserUpperStr']}. Activity item: {lActivityItem}")
|
|
|
|
|
inRequest.OpenRPAResponseDict["Body"] = bytes(json.dumps(lActivityItem), "utf8")
|
|
|
|
|
lDoLoopBool = False # CLose the connection
|
|
|
|
|
else: # no queue item - sleep for the next iteration
|
|
|
|
|
time.sleep(1)
|
|
|
|
|