fix for older python versions

This commit is contained in:
odysseusmax 2021-11-02 21:45:27 +05:30
parent df65e3ba49
commit b2539699fa
1 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import asyncio
import pathlib import pathlib
import logging import logging
@ -46,6 +47,8 @@ class Indexer:
) )
middlewares.append(middleware_factory()) middlewares.append(middleware_factory())
self.loop = asyncio.get_event_loop()
self.server = web.Application(middlewares=middlewares) self.server = web.Application(middlewares=middlewares)
self.server.on_startup.append(self.startup) self.server.on_startup.append(self.startup)
@ -71,4 +74,4 @@ class Indexer:
log.debug("telegram client disconnected!") log.debug("telegram client disconnected!")
def run(self): def run(self):
web.run_app(self.server, host=host, port=port) web.run_app(self.server, host=host, port=port, loop=self.loop)