debug: verify monkey-patch in init
This commit is contained in:
parent
ac330eb097
commit
b51eb9f626
12
app/pccs.py
12
app/pccs.py
@ -22,13 +22,11 @@ def init():
|
||||
|
||||
DictObject.__getattr__ = _patched
|
||||
|
||||
# 初始化全局 DBPools — sqlor 的 get_sor_context 创建新 DBPools() 时
|
||||
# 需要能拿到 databases。通过 sqlor.dbpools 模块级全局变量共享。
|
||||
from sqlor.dbpools import DBPools
|
||||
from appPublic.jsonConfig import getConfig
|
||||
|
||||
config = getConfig()
|
||||
DBPools(config.databases)
|
||||
# 验证 monkey-patch 生效
|
||||
from ahserver.serverenv import ServerEnv
|
||||
e = ServerEnv()
|
||||
dbname = e.get_module_dbname('rbac')
|
||||
print(f'[pccs] get_module_dbname(rbac) = {dbname}', flush=True)
|
||||
|
||||
from appbase.init import load_appbase
|
||||
from rbac.init import load_rbac
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user