From 91e823d2c4304478282bf057a4d845b33dfef852 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 23 Jul 2024 18:03:19 +0800 Subject: [PATCH] bugfix --- ahserver/configuredServer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ahserver/configuredServer.py b/ahserver/configuredServer.py index 26872d2..7dc45d5 100755 --- a/ahserver/configuredServer.py +++ b/ahserver/configuredServer.py @@ -9,6 +9,7 @@ from appPublic.folderUtils import ProgramPath from appPublic.dictObject import DictObject from appPublic.jsonConfig import getConfig from appPublic.log import info, debug, warning, error, critical, exception +from appPublic.registerfunction import RegisterCoroutine from sqlor.dbpools import DBPools @@ -49,10 +50,12 @@ class ConfiguredServer: if config.website.client_max_size: client_max_size = config.website.client_max_size - load_plugins(self.workdir) self.app = AHApp(client_max_size=client_max_size) + load_plugins(self.workdir) - async def init_auth(self): + async def build_app(self): + rf = RegisterCoroutine() + await rf.exe('ahapp_built', self.app) auth = self.auth_klass() await auth.setupAuth(self.app) return self.app @@ -72,7 +75,7 @@ class ConfiguredServer: if platform != 'win32': reuse_port = True print('reuse_port=', reuse_port) - web.run_app(self.init_auth(),host=config.website.host or '0.0.0.0', + web.run_app(self.build_app(),host=config.website.host or '0.0.0.0', port=port, reuse_port=reuse_port, ssl_context=ssl_context)