File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1512,6 +1512,7 @@ export class Instance implements Disposable {
15121512 totalBytes += list [ i ] . nbytes ;
15131513 }
15141514 let fetchedBytes = 0 ;
1515+ let fetchedShards = 0 ;
15151516 let timeElapsed = 0 ;
15161517
15171518 const cacheOnly = await artifactCache . hasAllKeys ( list . map ( key => new URL ( key . dataPath , ndarrayCacheUrl ) . href ) )
@@ -1550,9 +1551,7 @@ export class Instance implements Disposable {
15501551 }
15511552
15521553 const processShard = async ( i : number ) => {
1553- reportCallback ( i ) ;
15541554 const shard = list [ i ] ;
1555- fetchedBytes += shard . nbytes ;
15561555 const dataUrl = new URL ( shard . dataPath , ndarrayCacheUrl ) . href ;
15571556 let buffer ;
15581557 try {
@@ -1591,6 +1590,8 @@ export class Instance implements Disposable {
15911590 }
15921591 }
15931592 timeElapsed = Math . ceil ( ( perf . now ( ) - tstart ) / 1000 ) ;
1593+ fetchedBytes += shard . nbytes ;
1594+ reportCallback ( fetchedShards ++ ) ;
15941595 }
15951596 await Promise . all ( list . map ( ( _ , index ) => processShard ( index ) ) ) ;
15961597 reportCallback ( list . length ) ;
You can’t perform that action at this time.
0 commit comments