chore: prepare repository for submodule split

This commit is contained in:
2026-07-09 09:00:51 +00:00
parent 9e545cb328
commit e9a2400c48
33 changed files with 4175 additions and 1545 deletions
+18
View File
@@ -105,6 +105,24 @@ def put_file(object_path: str, data: bytes, size: int):
return {'storage': 'local', 'path': str(local_path)}
def put_file_stream(object_path: str, source, size: int):
bucket = MINIO_BUCKET
try:
source.seek(0)
mc.put_object(bucket, object_path, source, length=size)
return {'storage': 'minio', 'path': object_path}
except Exception as e:
print(f"minio put_file_stream error: {e}")
local_path = LOCAL_UPLOAD_ROOT / object_path
local_path.parent.mkdir(parents=True, exist_ok=True)
source.seek(0)
with open(local_path, 'wb') as target:
shutil.copyfileobj(source, target, length=1024 * 1024)
print(f"local fallback stored {local_path}")
return {'storage': 'local', 'path': str(local_path)}
def remove_prefix(prefix: str):
bucket = MINIO_BUCKET
try: