Fix incorrect exception handling in db query (#23582)

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
This commit is contained in:
Yongtao Huang
2025-08-08 10:07:59 +09:00
committed by GitHub
parent 2edd32fdea
commit c8c591d73c
5 changed files with 20 additions and 20 deletions

View File

@@ -3,7 +3,7 @@ import logging
import time
import click
from werkzeug.exceptions import NotFound
from sqlalchemy.exc import SQLAlchemyError
import app
from configs import dify_config
@@ -42,8 +42,8 @@ def clean_messages():
.all()
)
except NotFound:
break
except SQLAlchemyError:
raise
if not messages:
break
for message in messages: