mirror of
https://github.com/gogcom/galaxy-integrations-python-api.git
synced 2026-01-23 14:19:04 -05:00
Wait until writer is closed
This commit is contained in:
@@ -1021,10 +1021,15 @@ def create_and_run_plugin(plugin_class, argv):
|
||||
|
||||
async def coroutine():
|
||||
reader, writer = await asyncio.open_connection("127.0.0.1", port)
|
||||
extra_info = writer.get_extra_info("sockname")
|
||||
logger.info("Using local address: %s:%u", *extra_info)
|
||||
async with plugin_class(reader, writer, token) as plugin:
|
||||
await plugin.run()
|
||||
try:
|
||||
extra_info = writer.get_extra_info("sockname")
|
||||
logger.info("Using local address: %s:%u", *extra_info)
|
||||
async with plugin_class(reader, writer, token) as plugin:
|
||||
await plugin.run()
|
||||
finally:
|
||||
writer.close()
|
||||
await writer.wait_closed()
|
||||
|
||||
|
||||
try:
|
||||
if sys.platform == "win32":
|
||||
|
||||
Reference in New Issue
Block a user