From 312615cde9ed9991672adff7e1d79652073dd5b6 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 23 May 2023 09:38:22 +0800 Subject: [PATCH] bugfix --- appPublic/asynciorun.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 appPublic/asynciorun.py diff --git a/appPublic/asynciorun.py b/appPublic/asynciorun.py new file mode 100755 index 0000000..25cddc6 --- /dev/null +++ b/appPublic/asynciorun.py @@ -0,0 +1,15 @@ +import asyncio +import ays +from sqlor import DBPools +from appPublic.jsonConfig import getConfig + +def run(coro): + p = '.' + if len(sys.argv) > 1: + p = sys.argv[1] + config = getConfig(p, {'woridir':p}) + DBPools(config.databases) + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + loop.run_until_complete(coro()) +