Эх сурвалжийг харах

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

luojiehua 1 жил өмнө
parent
commit
5a1d4de3ee

+ 3 - 0
BaseDataMaintenance/common/ossUtils.py

@@ -57,6 +57,9 @@ def deleteObject(bucket,objectName):
 def downloadFile(bucket,objectPath,localPath,retry=3):
 def downloadFile(bucket,objectPath,localPath,retry=3):
     for i in range(retry):
     for i in range(retry):
         try:
         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)
             # bucket.get_object_to_file(objectPath, localPath)
             oss2.resumable_download(bucket, objectPath, localPath,
             oss2.resumable_download(bucket, objectPath, localPath,
                                     store=oss2.ResumableDownloadStore(),
                                     store=oss2.ResumableDownloadStore(),