Add optional tenant_id parameter to Minio methods
This commit is contained in:
parent
5a50ed5fcc
commit
12316fca3b
1 changed files with 5 additions and 5 deletions
|
|
@ -108,7 +108,7 @@ class RAGFlowMinio:
|
||||||
|
|
||||||
@use_default_bucket
|
@use_default_bucket
|
||||||
@use_prefix_path
|
@use_prefix_path
|
||||||
def put(self, bucket, fnm, binary):
|
def put(self, bucket, fnm, binary, tenant_id=None):
|
||||||
for _ in range(3):
|
for _ in range(3):
|
||||||
try:
|
try:
|
||||||
# Note: bucket must already exist - we don't have permission to create buckets
|
# Note: bucket must already exist - we don't have permission to create buckets
|
||||||
|
|
@ -127,7 +127,7 @@ class RAGFlowMinio:
|
||||||
|
|
||||||
@use_default_bucket
|
@use_default_bucket
|
||||||
@use_prefix_path
|
@use_prefix_path
|
||||||
def rm(self, bucket, fnm):
|
def rm(self, bucket, fnm, tenant_id=None):
|
||||||
try:
|
try:
|
||||||
self.conn.remove_object(bucket, fnm)
|
self.conn.remove_object(bucket, fnm)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
@ -135,7 +135,7 @@ class RAGFlowMinio:
|
||||||
|
|
||||||
@use_default_bucket
|
@use_default_bucket
|
||||||
@use_prefix_path
|
@use_prefix_path
|
||||||
def get(self, bucket, filename):
|
def get(self, bucket, filename, tenant_id=None):
|
||||||
for _ in range(1):
|
for _ in range(1):
|
||||||
try:
|
try:
|
||||||
r = self.conn.get_object(bucket, filename)
|
r = self.conn.get_object(bucket, filename)
|
||||||
|
|
@ -148,7 +148,7 @@ class RAGFlowMinio:
|
||||||
|
|
||||||
@use_default_bucket
|
@use_default_bucket
|
||||||
@use_prefix_path
|
@use_prefix_path
|
||||||
def obj_exist(self, bucket, filename):
|
def obj_exist(self, bucket, filename, tenant_id=None):
|
||||||
try:
|
try:
|
||||||
if not self.conn.bucket_exists(bucket):
|
if not self.conn.bucket_exists(bucket):
|
||||||
return False
|
return False
|
||||||
|
|
@ -179,7 +179,7 @@ class RAGFlowMinio:
|
||||||
|
|
||||||
@use_default_bucket
|
@use_default_bucket
|
||||||
@use_prefix_path
|
@use_prefix_path
|
||||||
def get_presigned_url(self, bucket, fnm, expires):
|
def get_presigned_url(self, bucket, fnm, expires, tenant_id=None):
|
||||||
for _ in range(10):
|
for _ in range(10):
|
||||||
try:
|
try:
|
||||||
return self.conn.get_presigned_url("GET", bucket, fnm, expires)
|
return self.conn.get_presigned_url("GET", bucket, fnm, expires)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue