This commit is contained in:
yumoqing 2024-07-23 18:03:19 +08:00
parent d1d9fb7e04
commit 91e823d2c4

View File

@ -9,6 +9,7 @@ from appPublic.folderUtils import ProgramPath
from appPublic.dictObject import DictObject from appPublic.dictObject import DictObject
from appPublic.jsonConfig import getConfig from appPublic.jsonConfig import getConfig
from appPublic.log import info, debug, warning, error, critical, exception from appPublic.log import info, debug, warning, error, critical, exception
from appPublic.registerfunction import RegisterCoroutine
from sqlor.dbpools import DBPools from sqlor.dbpools import DBPools
@ -49,10 +50,12 @@ class ConfiguredServer:
if config.website.client_max_size: if config.website.client_max_size:
client_max_size = 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) 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() auth = self.auth_klass()
await auth.setupAuth(self.app) await auth.setupAuth(self.app)
return self.app return self.app
@ -72,7 +75,7 @@ class ConfiguredServer:
if platform != 'win32': if platform != 'win32':
reuse_port = True reuse_port = True
print('reuse_port=', reuse_port) 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, port=port,
reuse_port=reuse_port, reuse_port=reuse_port,
ssl_context=ssl_context) ssl_context=ssl_context)