From 693f2988bed8824e2b3fbbd1c11ec27c05f3e1f9 Mon Sep 17 00:00:00 2001 From: Ocetars Date: Thu, 4 Dec 2025 16:38:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(command):=20=E7=A1=AE=E4=BF=9D=E6=96=B0?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E9=85=8D=E7=BD=AE=E7=9A=84=E4=BA=8B=E5=8A=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/db/sqlite.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/astrbot/core/db/sqlite.py b/astrbot/core/db/sqlite.py index ee031ebcc..ffa37f1e5 100644 --- a/astrbot/core/db/sqlite.py +++ b/astrbot/core/db/sqlite.py @@ -695,7 +695,8 @@ class SQLiteDatabase(BaseDatabase): config.auto_managed = auto_managed await session.flush() await session.refresh(config) - return config + await session.commit() + return config async def delete_command_config(self, handler_full_name: str) -> None: await self.delete_command_configs([handler_full_name]) @@ -711,6 +712,7 @@ class SQLiteDatabase(BaseDatabase): col(CommandConfig.handler_full_name).in_(handler_full_names), ), ) + await session.commit() async def list_command_conflicts( self, @@ -776,7 +778,8 @@ class SQLiteDatabase(BaseDatabase): record.auto_generated = auto_generated await session.flush() await session.refresh(record) - return record + await session.commit() + return record async def delete_command_conflicts(self, ids: list[int]) -> None: if not ids: @@ -787,6 +790,7 @@ class SQLiteDatabase(BaseDatabase): await session.execute( delete(CommandConflict).where(col(CommandConflict.id).in_(ids)), ) + await session.commit() # ==== # Deprecated Methods