fix: add @asynccontextmanager to patched get_sor_context
This commit is contained in:
parent
186ed11d55
commit
8c378f0ef0
@ -3,6 +3,7 @@ pccs — 算力中心集群系统 (Pooled Computing Cluster System)
|
||||
入口: webapp(init) 模式
|
||||
"""
|
||||
import os, sys
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
# ═══ 最早导入并 patch sqlor, 确保所有后续 import 拿到 patched 版本 ═══
|
||||
import sqlor.dbpools as _dbp
|
||||
@ -16,6 +17,7 @@ _global_db = _dbp.DBPools(_config.databases)
|
||||
_orig_sor_ctx = _dbp.get_sor_context
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def _patched_sor_ctx(env, modulename, errorback=None):
|
||||
dbname = env.get_module_dbname(modulename)
|
||||
async with _global_db.sqlorContext(dbname) as sor:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user