mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 02:49:00 +08:00
ignore when save image fail (#2178)
### What problem does this PR solve? ### Type of change - [x] Performance Improvement
This commit is contained in:
parent
5400467da1
commit
fc6d8ee77f
@ -206,15 +206,20 @@ def build(row):
|
||||
docs.append(d)
|
||||
continue
|
||||
|
||||
output_buffer = BytesIO()
|
||||
if isinstance(d["image"], bytes):
|
||||
output_buffer = BytesIO(d["image"])
|
||||
else:
|
||||
d["image"].save(output_buffer, format='JPEG')
|
||||
try:
|
||||
output_buffer = BytesIO()
|
||||
if isinstance(d["image"], bytes):
|
||||
output_buffer = BytesIO(d["image"])
|
||||
else:
|
||||
d["image"].save(output_buffer, format='JPEG')
|
||||
|
||||
st = timer()
|
||||
MINIO.put(row["kb_id"], d["_id"], output_buffer.getvalue())
|
||||
el += timer() - st
|
||||
except Exception as e:
|
||||
cron_logger.error(str(e))
|
||||
traceback.print_exc()
|
||||
|
||||
st = timer()
|
||||
MINIO.put(row["kb_id"], d["_id"], output_buffer.getvalue())
|
||||
el += timer() - st
|
||||
d["img_id"] = "{}-{}".format(row["kb_id"], d["_id"])
|
||||
del d["image"]
|
||||
docs.append(d)
|
||||
|
Loading…
x
Reference in New Issue
Block a user