@@ -769,22 +769,19 @@ def getQueuedDataset():
769769 extractPath = path .join (app .config ['folders' ]['output_dir' ], id )
770770 file = path .join (extractPath , filename )
771771
772- if path .isfile (file ):
772+ try :
773+ bucket = S3Bucket (app .config ['s3' ]['bucket' ], app .logger )
774+ bucket .downloadFile (key , zipSave )
775+
776+ with ZipFile (zipSave ) as archive :
777+ archive .extractall (extractPath )
778+
773779 return send_file (file , as_attachment = True )
774- else :
775- try :
776- bucket = S3Bucket (app .config ['s3' ]['bucket' ], app .logger )
777- bucket .downloadFile (key , zipSave )
778-
779- with ZipFile (zipSave ) as archive :
780- archive .extractall (extractPath )
781-
782- return send_file (file , as_attachment = True )
783- except Exception as err :
784- message = "Download from S3 failed!\n " + str (err )
785- app .logger .error (message )
786- app .logger .exception (err )
787- return app .response_class (json .dumps (message ), 500 , mimetype = 'application/json' )
780+ except Exception as err :
781+ message = "Download from S3 failed!\n " + str (err )
782+ app .logger .error (message )
783+ app .logger .exception (err )
784+ return app .response_class (json .dumps (message ), 500 , mimetype = 'application/json' )
788785
789786
790787@app .route ('/api/recalculateBatch' , methods = ['POST' ])
0 commit comments