fix nats ping dict
This commit is contained in:
parent
24cb0565b9
commit
8459bca64a
|
@ -295,10 +295,10 @@ class Agent(BaseAuditModel):
|
||||||
|
|
||||||
running_agent = self
|
running_agent = self
|
||||||
if run_on_any:
|
if run_on_any:
|
||||||
nats_ping = {"func": "ping", "timeout": 1}
|
nats_ping = {"func": "ping"}
|
||||||
|
|
||||||
# try on self first
|
# try on self first
|
||||||
r = asyncio.run(self.nats_cmd(nats_ping))
|
r = asyncio.run(self.nats_cmd(nats_ping, timeout=1))
|
||||||
|
|
||||||
if r == "pong":
|
if r == "pong":
|
||||||
running_agent = self
|
running_agent = self
|
||||||
|
@ -312,7 +312,7 @@ class Agent(BaseAuditModel):
|
||||||
]
|
]
|
||||||
|
|
||||||
for agent in online:
|
for agent in online:
|
||||||
r = asyncio.run(agent.nats_cmd(nats_ping))
|
r = asyncio.run(agent.nats_cmd(nats_ping, timeout=1))
|
||||||
if r == "pong":
|
if r == "pong":
|
||||||
running_agent = agent
|
running_agent = agent
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue