Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle send timeout in admin websocket #377

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions aries_cloudagent/admin/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AdminModulesSchema(Schema):
"""Schema for the modules endpoint."""

result = fields.List(
fields.Str(description="admin module"), description="List of admin modules",
fields.Str(description="admin module"), description="List of admin modules"
)


Expand Down Expand Up @@ -377,7 +377,11 @@ async def websocket_handler(self, request):
receive = loop.create_task(ws.receive())

if send.done():
msg = send.result()
try:
msg = send.result()
except asyncio.TimeoutError:
msg = None

if msg is None:
# we send fake pings because the JS client
# can't detect real ones
Expand Down