mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
Checkpoint before follow-up message
Co-authored-by: jxxghp <jxxghp@live.cn>
This commit is contained in:
@@ -4,6 +4,7 @@ from app.core.config import settings
|
|||||||
from app.db import SessionFactory
|
from app.db import SessionFactory
|
||||||
from app.modules import _ModuleBase
|
from app.modules import _ModuleBase
|
||||||
from app.schemas.types import ModuleType, OtherModulesType
|
from app.schemas.types import ModuleType, OtherModulesType
|
||||||
|
from sqlalchemy import text
|
||||||
|
|
||||||
|
|
||||||
class PostgreSQLModule(_ModuleBase):
|
class PostgreSQLModule(_ModuleBase):
|
||||||
@@ -54,7 +55,7 @@ class PostgreSQLModule(_ModuleBase):
|
|||||||
# 测试数据库连接
|
# 测试数据库连接
|
||||||
db = SessionFactory()
|
db = SessionFactory()
|
||||||
try:
|
try:
|
||||||
db.execute("SELECT 1")
|
db.execute(text("SELECT 1"))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return False, f"PostgreSQL连接失败:{e}"
|
return False, f"PostgreSQL连接失败:{e}"
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in New Issue
Block a user