Fix logs. Use dict.pop instead of del. Close #3473 (#3484)

### What problem does this PR solve?

Fix logs. Use dict.pop instead of del.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Zhichang Yu
2024-11-19 14:15:25 +08:00
committed by GitHub
parent d0f94a42ff
commit dec9b3e540
13 changed files with 93 additions and 79 deletions

View File

@ -78,10 +78,13 @@ class RAGFlowMinio(object):
def obj_exist(self, bucket, fnm):
try:
if self.conn.stat_object(bucket, fnm):return True
if not self.conn.bucket_exists(bucket):
return False
if self.conn.stat_object(bucket, fnm):
return True
return False
except Exception:
logging.exception(f"Fail put {bucket}/{fnm}:")
logging.exception(f"RAGFlowMinio.obj_exist {bucket}/{fnm} got exception:")
return False