File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed
Umbraco.PublishedCache.HybridCache/Services Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -8,19 +8,39 @@ public class CacheSettings
8
8
{
9
9
internal const int StaticDocumentBreadthFirstSeedCount = 100 ;
10
10
internal const int StaticMediaBreadthFirstSeedCount = 100 ;
11
+ internal const int StaticDocumentSeedBatchSize = 100 ;
12
+ internal const int StaticMediaSeedBatchSize = 100 ;
11
13
12
14
/// <summary>
13
- /// Gets or sets a value for the collection of content type ids to always have in the cache.
15
+ /// Gets or sets a value for the collection of content type ids to always have in the cache.
14
16
/// </summary>
15
17
public List < Guid > ContentTypeKeys { get ; set ; } =
16
18
new ( ) ;
17
19
20
+ /// <summary>
21
+ /// Gets or sets a value for the document breadth first seed count.
22
+ /// </summary>
18
23
[ DefaultValue ( StaticDocumentBreadthFirstSeedCount ) ]
19
24
public int DocumentBreadthFirstSeedCount { get ; set ; } = StaticDocumentBreadthFirstSeedCount ;
20
25
26
+ /// <summary>
27
+ /// Gets or sets a value for the media breadth first seed count.
28
+ /// </summary>
21
29
[ DefaultValue ( StaticMediaBreadthFirstSeedCount ) ]
22
30
public int MediaBreadthFirstSeedCount { get ; set ; } = StaticDocumentBreadthFirstSeedCount ;
23
31
32
+ /// <summary>
33
+ /// Gets or sets a value for the document seed batch size.
34
+ /// </summary>
35
+ [ DefaultValue ( StaticDocumentSeedBatchSize ) ]
36
+ public int DocumentSeedBatchSize { get ; set ; } = StaticDocumentSeedBatchSize ;
37
+
38
+ /// <summary>
39
+ /// Gets or sets a value for the media seed batch size.
40
+ /// </summary>
41
+ [ DefaultValue ( StaticMediaSeedBatchSize ) ]
42
+ public int MediaSeedBatchSize { get ; set ; } = StaticMediaSeedBatchSize ;
43
+
24
44
public CacheEntry Entry { get ; set ; } = new CacheEntry ( ) ;
25
45
26
46
public class CacheEntry
Original file line number Diff line number Diff line change @@ -195,8 +195,7 @@ public async Task SeedAsync(CancellationToken cancellationToken)
195
195
sw . Start ( ) ;
196
196
#endif
197
197
198
- const int GroupSize = 100 ;
199
- foreach ( IEnumerable < Guid > group in SeedKeys . InGroupsOf ( GroupSize ) )
198
+ foreach ( IEnumerable < Guid > group in SeedKeys . InGroupsOf ( _cacheSettings . DocumentSeedBatchSize ) )
200
199
{
201
200
var uncachedKeys = new HashSet < Guid > ( ) ;
202
201
foreach ( Guid key in group )
Original file line number Diff line number Diff line change @@ -158,8 +158,7 @@ public async Task SeedAsync(CancellationToken cancellationToken)
158
158
sw . Start ( ) ;
159
159
#endif
160
160
161
- const int GroupSize = 100 ;
162
- foreach ( IEnumerable < Guid > group in SeedKeys . InGroupsOf ( GroupSize ) )
161
+ foreach ( IEnumerable < Guid > group in SeedKeys . InGroupsOf ( _cacheSettings . MediaSeedBatchSize ) )
163
162
{
164
163
var uncachedKeys = new HashSet < Guid > ( ) ;
165
164
foreach ( Guid key in group )
You can’t perform that action at this time.
0 commit comments