@@ -90,16 +90,16 @@ public async Task<OperationSummary> CompressAsync(CompressOption option)
9090
9191 private async Task < OperationCompressionBlock > UploadBlockInternal ( IEnumerable < IRemoteStorage > uploaders , CompressOption option , OperationCompressionBlock block , CancellationToken token )
9292 {
93- foreach ( var uploader in uploaders )
93+ int count = Interlocked . Increment ( ref _uploadCounter ) ;
94+ string progress = $ "{ count } /{ _totalCounter } ";
95+
96+ foreach ( var uploader in uploaders )
9497 {
9598 if ( uploader is NoneRemoteStorage )
9699 {
97100 continue ;
98101 }
99102
100- int count = Interlocked . Increment ( ref _uploadCounter ) ;
101- string progress = $ "{ count } /{ _totalCounter } ";
102-
103103 var file = block . CompressionBlock . DestinationArchiveFileInfo ;
104104 var name = file . Name ;
105105 RetryContext ctx = null ;
@@ -129,15 +129,15 @@ private async Task<OperationCompressionBlock> UploadBlockInternal(IEnumerable<IR
129129
130130 if ( ! hasError )
131131 {
132- _logger . LogInformation ( $ "{ progress } Uploaded \" { file . Name } \" in { sw . Elapsed . HumanizedTimeSpan ( ) } at { speed . HumanizedBandwidth ( ) } ") ;
132+ _logger . LogInformation ( $ "[ { uploader . GetMode ( ) } ] { progress } Uploaded \" { file . Name } \" in { sw . Elapsed . HumanizedTimeSpan ( ) } at { speed . HumanizedBandwidth ( ) } ") ;
133133 }
134134 else
135135 {
136136 if ( ctx == null && option . RetryPeriodInSeconds . HasValue )
137137 {
138138 ctx = new RetryContext ( option . RetryPeriodInSeconds . Value ) ;
139139 }
140- _logger . LogError ( $ "{ progress } Uploaded { file . Name } with errors. { result . ErrorMessage } ") ;
140+ _logger . LogError ( $ "[ { uploader . GetMode ( ) } ] { progress } Uploaded { file . Name } with errors. { result . ErrorMessage } ") ;
141141 }
142142 }
143143 catch ( Exception e )
@@ -147,14 +147,14 @@ private async Task<OperationCompressionBlock> UploadBlockInternal(IEnumerable<IR
147147 {
148148 ctx = new RetryContext ( option . RetryPeriodInSeconds . Value ) ;
149149 }
150- _logger . LogCritical ( e , $ "{ progress } Error uploading { name } ") ;
150+ _logger . LogCritical ( e , $ "[ { uploader . GetMode ( ) } ] { progress } Error uploading { name } ") ;
151151 }
152152
153153 if ( hasError )
154154 {
155155 if ( ctx != null && await ctx . WaitForNextRetry ( ) )
156156 {
157- _logger . LogWarning ( $ "{ progress } Retrying uploading { name } , attempt #{ ctx . Retries } ") ;
157+ _logger . LogWarning ( $ "[ { uploader . GetMode ( ) } ] { progress } Retrying uploading { name } , attempt #{ ctx . Retries } ") ;
158158 }
159159 else
160160 {
0 commit comments