@@ -19,27 +19,28 @@ public static async Task<List<ListedItem>> ListEntries(
1919 Func < List < ListedItem > , Task > intermediateAction ,
2020 Dictionary < string , BitmapImage > defaultIconPairs = null )
2121 {
22- var sampler = new IntervalSampler ( 500 ) ;
22+ var sampler = new IntervalSampler ( 5000 ) ;
2323 var tempList = new List < ListedItem > ( ) ;
2424 uint count = 0 ;
2525 var firstRound = true ;
26+ var disableIntermediateUpdates = false ;
2627
2728 IUserSettingsService userSettingsService = Ioc . Default . GetRequiredService < IUserSettingsService > ( ) ;
2829
2930 while ( true )
3031 {
3132 IReadOnlyList < IStorageItem > items ;
3233
33- uint maxItemsToRetrieve = 300 ;
34+ uint maxItemsToRetrieve = 5000 ;
3435
3536 if ( intermediateAction is null )
3637 {
3738 // without intermediate action increase batches significantly
38- maxItemsToRetrieve = 1000 ;
39+ maxItemsToRetrieve = 10000 ;
3940 }
4041 else if ( firstRound )
4142 {
42- maxItemsToRetrieve = 32 ;
43+ maxItemsToRetrieve = 1000 ;
4344 firstRound = false ;
4445 }
4546
@@ -116,7 +117,10 @@ ex is FileNotFoundException ||
116117 if ( countLimit > - 1 && count >= countLimit )
117118 break ;
118119
119- if ( intermediateAction is not null && ( items . Count == maxItemsToRetrieve || sampler . CheckNow ( ) ) )
120+ if ( count > 50000 && ! disableIntermediateUpdates )
121+ disableIntermediateUpdates = true ;
122+
123+ if ( intermediateAction is not null && ! disableIntermediateUpdates && ( items . Count == maxItemsToRetrieve || sampler . CheckNow ( ) ) )
120124 {
121125 await intermediateAction ( tempList ) ;
122126
0 commit comments