From 2a0c3364d0202e8467b068ee71f506ed2afeaa73 Mon Sep 17 00:00:00 2001 From: "shuohigh@gmail.com" Date: Tue, 24 Jun 2025 15:18:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=BAcache=E6=96=87=E4=BB=B6batch?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=9A=84=E5=A4=8D=E5=88=B6=E5=92=8C=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E8=A1=8C=E4=B8=BA=E5=88=9B=E5=BB=BA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BowongModalFunctions/router/cache.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/BowongModalFunctions/router/cache.py b/src/BowongModalFunctions/router/cache.py index a1aad50..f2adddd 100644 --- a/src/BowongModalFunctions/router/cache.py +++ b/src/BowongModalFunctions/router/cache.py @@ -13,6 +13,7 @@ from fastapi.responses import JSONResponse, RedirectResponse from starlette import status import boto3 from botocore.config import Config +from typing_inspection.typing_objects import target from ..config import WorkerConfig from ..middleware.authorization import verify_token @@ -235,6 +236,8 @@ async def s3_copy(body: ClusterCacheBatchRequest) -> ClusterCacheBatchResponse: results: List[CacheTaskResult] = [] for task in body.tasks: try: + if task.target: + os.makedirs(os.path.dirname(task.target.local_mount_path), exist_ok=True) match task.type: case CacheOperationType.copy: shutil.copy(task.source.local_mount_path, task.target.local_mount_path)