This commit is contained in:
AF 2021-11-28 00:22:56 +03:00
parent 3edb6cf3f2
commit 4d5755409d

View File

@ -1,7 +1,6 @@
import asyncio
from aiohttp import web
from v6d0auth.config import port, host
from v6d0auth.run_app import run_app
from v6d1tokens.app import get_app
from v6d1tokens.tdb import TDB
@ -11,17 +10,7 @@ async def main():
tdb = TDB()
app = get_app(tdb)
async with tdb.db:
runner = web.AppRunner(app)
await runner.setup()
site = web.TCPSite(runner, host=host, port=port)
await site.start()
names = sorted(str(s.name) for s in runner.sites)
print(
"======== Running on {} ========\n"
"(Press CTRL+C to quit)".format(", ".join(names))
)
while True:
await asyncio.sleep(3600)
await run_app(app)
if __name__ == '__main__':