@@ -203,26 +203,26 @@ private IEnumerable<ExportRequestDataMessage> DownloadPayloadActionCallback(Expo
203
203
{
204
204
try
205
205
{
206
+ _logger . Log ( LogLevel . Debug , $ "Downloading file { file } ...") ;
206
207
Policy
207
- . Handle < Exception > ( )
208
- . WaitAndRetry (
209
- _configuration . Export . Retries . RetryDelays ,
210
- ( exception , timeSpan , retryCount , context ) =>
211
- {
212
- _logger . Log ( LogLevel . Error , exception , $ "Error downloading payload. Waiting { timeSpan } before next retry. Retry attempt { retryCount } .") ;
213
- } )
214
- . Execute ( ( ) =>
215
- {
216
- var task = storageService . GetObject ( _configuration . Storage . StorageServiceBucketName , file , ( stream ) =>
217
- {
218
- stream . Seek ( 0 , System . IO . SeekOrigin . Begin ) ;
219
- using var memoryStream = new MemoryStream ( ) ;
220
- stream . CopyTo ( memoryStream ) ;
221
- exportRequestData . SetData ( memoryStream . ToArray ( ) ) ;
222
- } , cancellationToken ) ;
223
-
224
- task . Wait ( ) ;
225
- } ) ;
208
+ . Handle < Exception > ( )
209
+ . WaitAndRetry (
210
+ _configuration . Export . Retries . RetryDelays ,
211
+ ( exception , timeSpan , retryCount , context ) =>
212
+ {
213
+ _logger . Log ( LogLevel . Error , exception , $ "Error downloading payload. Waiting { timeSpan } before next retry. Retry attempt { retryCount } .") ;
214
+ } )
215
+ . Execute ( ( ) =>
216
+ {
217
+ storageService . GetObject ( _configuration . Storage . StorageServiceBucketName , file , ( stream ) =>
218
+ {
219
+ _logger . Log ( LogLevel . Debug , $ "Copying file { file } ...") ;
220
+ using var memoryStream = new MemoryStream ( ) ;
221
+ stream . CopyTo ( memoryStream ) ;
222
+ exportRequestData . SetData ( memoryStream . ToArray ( ) ) ;
223
+ _logger . Log ( LogLevel . Debug , $ "File { file } ready for export...") ;
224
+ } , cancellationToken ) . Wait ( ) ;
225
+ } ) ;
226
226
}
227
227
catch ( Exception ex )
228
228
{
@@ -302,4 +302,4 @@ private void ReportingActionBlock(ExportRequestDataMessage exportRequestData)
302
302
} ) ;
303
303
}
304
304
}
305
- }
305
+ }
0 commit comments