Skip to content

Commit 11850f0

Browse files
committed
fix cli script; asyncio.run must be called
Resolves this error: Sep 06 17:34:19 jhoblitt-test2.dev.lsst.org systemd-s3daemon[696498]: <coroutine object main at 0x7faf99dd1f40> Sep 06 17:34:19 jhoblitt-test2.dev.lsst.org systemd-s3daemon[696498]: sys:1: RuntimeWarning: coroutine 'main' was never awaited Sep 06 17:34:19 jhoblitt-test2.dev.lsst.org systemd-s3daemon[696498]: RuntimeWarning: Enable tracemalloc to get the object allocation traceback
1 parent 69080f2 commit 11850f0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python/s3daemon/s3daemon.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def handle_client(client, reader, writer):
7676
log.info("%f %f sec", start, time.time() - start)
7777

7878

79-
async def main():
79+
async def go():
8080
"""Start the server."""
8181
session = aiobotocore.session.get_session()
8282
async with session.create_client(
@@ -96,5 +96,10 @@ async def client_cb(reader, writer):
9696
await server.serve_forever()
9797

9898

99+
def main():
100+
"""CLI script entry point."""
101+
asyncio.run(go())
102+
103+
99104
if __name__ == "__main__":
100-
asyncio.run(main())
105+
main()

0 commit comments

Comments
 (0)