Skip to content

Commit

Permalink
Update appserver.py
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan authored Oct 7, 2023
1 parent fb1f59b commit fa92dee
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions htagweb/appserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,16 @@ async def loop_tag_update(self, event, websocket):
with redys.v2.AClient() as bus:
await bus.subscribe(event)

ok=True
while ok:
actions = await bus.get_event( event )
if actions is not None:
ok=await self._sendback(websocket,json.dumps(actions))
await asyncio.sleep(0.1)

try:
ok=True
while ok:
actions = await bus.get_event( event )
if actions is not None:
ok=await self._sendback(websocket,json.dumps(actions))
await asyncio.sleep(0.1)
except:
print("**loop_tag_update, broken bus, will stop the loop_tag_update !**")

async def on_connect(self, websocket):
#====================================================== get the event
fqn=websocket.path_params.get("fqn","")
Expand Down

0 comments on commit fa92dee

Please sign in to comment.