瀏覽代碼

修复附件数据处理慢的问题

luojiehua 1 年之前
父節點
當前提交
5a1d4de3ee
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      BaseDataMaintenance/common/ossUtils.py

+ 3 - 0
BaseDataMaintenance/common/ossUtils.py

@@ -57,6 +57,9 @@ def deleteObject(bucket,objectName):
 def downloadFile(bucket,objectPath,localPath,retry=3):
     for i in range(retry):
         try:
+            if not os.path.exists(localPath):
+                if not os.path.exists(os.path.dirname(localPath)):
+                    os.makedirs(os.path.dirname(localPath))
             # bucket.get_object_to_file(objectPath, localPath)
             oss2.resumable_download(bucket, objectPath, localPath,
                                     store=oss2.ResumableDownloadStore(),