fix:角色基础修正
This commit is contained in:
@@ -3,6 +3,7 @@ from pathlib import Path
|
||||
import redis
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.pool import NullPool
|
||||
from config.main import config
|
||||
|
||||
RedisPool = redis.ConnectionPool.from_url(config.REDIS_URL)
|
||||
@@ -21,7 +22,11 @@ def get_redis():
|
||||
@cache
|
||||
def get_db_engine(version='0'):
|
||||
db_path = BACKEND_DIR / 'dataFiles' / f'dcalc_{version}.db'
|
||||
return create_engine(f'sqlite:///{db_path}', connect_args={'check_same_thread': False})
|
||||
return create_engine(
|
||||
f'sqlite:///{db_path}',
|
||||
connect_args={'check_same_thread': False},
|
||||
poolclass=NullPool,
|
||||
)
|
||||
|
||||
|
||||
def get_db():
|
||||
|
||||
Reference in New Issue
Block a user