mirror of https://github.com/langgenius/dify.git
fix: document delete image files check file exist (#21991)
This commit is contained in:
parent
b654c852a5
commit
5b0b64c7e5
|
|
@ -317,9 +317,10 @@ class IndexingRunner:
|
|||
image_upload_file_ids = get_image_upload_file_ids(document.page_content)
|
||||
for upload_file_id in image_upload_file_ids:
|
||||
image_file = db.session.query(UploadFile).filter(UploadFile.id == upload_file_id).first()
|
||||
if image_file is None:
|
||||
continue
|
||||
try:
|
||||
if image_file:
|
||||
storage.delete(image_file.key)
|
||||
storage.delete(image_file.key)
|
||||
except Exception:
|
||||
logging.exception(
|
||||
"Delete image_files failed while indexing_estimate, \
|
||||
|
|
|
|||
Loading…
Reference in New Issue