ソースを参照

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

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(),