@@ -203,6 +203,7 @@ private async Task ArchiveDotNetZip(string packageId, string archivePathTemp)
203
203
204
204
_log . LogInformation ( $ "Starting archive generation for package \" { packageId } \" . Type: .Net compression. Rate : { _settings . ArchiveCompression } .") ;
205
205
206
+ // static progress handler, this calculates percentage from tick events returned by zip
206
207
ProgressEvent progressEvent = ( long delta , long localTotal ) => {
207
208
progress += delta ;
208
209
int thisPercent = Percent . Calc ( progress , total ) ;
@@ -218,7 +219,7 @@ private async Task ArchiveDotNetZip(string packageId, string archivePathTemp)
218
219
} ;
219
220
220
221
progress . State = PackageArchiveCreationStates . ArchiveGenerating ;
221
- progress . CombinedPercent = percent ;
222
+ progress . PercentProgress = percent ;
222
223
_cache . Set ( progressCacheKey , progress ) ;
223
224
}
224
225
} ;
@@ -228,7 +229,7 @@ private async Task ArchiveDotNetZip(string packageId, string archivePathTemp)
228
229
{
229
230
// Note : no null check here, we assume DoesPackageExist test above would catch invalid names
230
231
Manifest manifest = _indexReader . GetManifest ( packageId ) ;
231
- total = manifest . SizeOnDisk ;
232
+ total = manifest . Size ;
232
233
233
234
using ( ZipArchive archive = new ZipArchive ( zipStream , ZipArchiveMode . Create , true ) )
234
235
{
@@ -248,10 +249,10 @@ private async Task ArchiveDotNetZip(string packageId, string archivePathTemp)
248
249
{
249
250
ZipArchiveEntry storageArchiveEntry = storageArchive . Entries [ 0 ] ;
250
251
using ( var storageArchiveStream = storageArchiveEntry . Open ( ) )
251
- {
252
- StreamProgressCopy copy = new StreamProgressCopy ( storageArchiveStream , zipStream , copyStepSize ) ;
253
- copy . OnProgress += progressEvent ;
254
- await copy . Work ( ) ;
252
+ {
253
+ StreamProgressCopy copy = new StreamProgressCopy ( storageArchiveStream , zipEntryStream , copyStepSize ) ;
254
+ copy . OnProgress += progressEvent ;
255
+ await copy . Work ( ) ;
255
256
}
256
257
}
257
258
}
@@ -263,7 +264,7 @@ private async Task ArchiveDotNetZip(string packageId, string archivePathTemp)
263
264
264
265
using ( Stream fileStream = fileLookup . Content )
265
266
{
266
- StreamProgressCopy copy = new StreamProgressCopy ( fileStream , zipStream , copyStepSize ) ;
267
+ StreamProgressCopy copy = new StreamProgressCopy ( fileStream , zipEntryStream , copyStepSize ) ;
267
268
copy . OnProgress += progressEvent ;
268
269
await copy . Work ( ) ;
269
270
}
0 commit comments