@@ -88,13 +88,18 @@ func NewLocalOnlyDispatcherWithLimits(concurrencyLimits ConcurrencyLimits, dispa
88
88
d := & localDispatcher {}
89
89
90
90
concurrencyLimits = limitsOrDefaults (concurrencyLimits , defaultConcurrencyLimit )
91
+ chunkSize := dispatchChunkSize
92
+ if chunkSize == 0 {
93
+ chunkSize = 100
94
+ log .Warn ().Msgf ("LocalOnlyDispatcher: dispatchChunkSize not set, defaulting to %d" , chunkSize )
95
+ }
91
96
92
- d .checker = graph .NewConcurrentChecker (d , concurrencyLimits .Check , dispatchChunkSize )
97
+ d .checker = graph .NewConcurrentChecker (d , concurrencyLimits .Check , chunkSize )
93
98
d .expander = graph .NewConcurrentExpander (d )
94
- d .reachableResourcesHandler = graph .NewCursoredReachableResources (d , concurrencyLimits .ReachableResources , dispatchChunkSize )
95
- d .lookupResourcesHandler = graph .NewCursoredLookupResources (d , d , concurrencyLimits .LookupResources , dispatchChunkSize )
96
- d .lookupSubjectsHandler = graph .NewConcurrentLookupSubjects (d , concurrencyLimits .LookupSubjects , dispatchChunkSize )
97
- d .lookupResourcesHandler2 = graph .NewCursoredLookupResources2 (d , d , concurrencyLimits .LookupResources , dispatchChunkSize )
99
+ d .reachableResourcesHandler = graph .NewCursoredReachableResources (d , concurrencyLimits .ReachableResources , chunkSize )
100
+ d .lookupResourcesHandler = graph .NewCursoredLookupResources (d , d , concurrencyLimits .LookupResources , chunkSize )
101
+ d .lookupSubjectsHandler = graph .NewConcurrentLookupSubjects (d , concurrencyLimits .LookupSubjects , chunkSize )
102
+ d .lookupResourcesHandler2 = graph .NewCursoredLookupResources2 (d , d , concurrencyLimits .LookupResources , chunkSize )
98
103
99
104
return d
100
105
}
@@ -103,13 +108,18 @@ func NewLocalOnlyDispatcherWithLimits(concurrencyLimits ConcurrencyLimits, dispa
103
108
// the provided redispatcher.
104
109
func NewDispatcher (redispatcher dispatch.Dispatcher , concurrencyLimits ConcurrencyLimits , dispatchChunkSize uint16 ) dispatch.Dispatcher {
105
110
concurrencyLimits = limitsOrDefaults (concurrencyLimits , defaultConcurrencyLimit )
111
+ chunkSize := dispatchChunkSize
112
+ if chunkSize == 0 {
113
+ chunkSize = 100
114
+ log .Warn ().Msgf ("Dispatcher: dispatchChunkSize not set, defaulting to %d" , chunkSize )
115
+ }
106
116
107
- checker := graph .NewConcurrentChecker (redispatcher , concurrencyLimits .Check , dispatchChunkSize )
117
+ checker := graph .NewConcurrentChecker (redispatcher , concurrencyLimits .Check , chunkSize )
108
118
expander := graph .NewConcurrentExpander (redispatcher )
109
- reachableResourcesHandler := graph .NewCursoredReachableResources (redispatcher , concurrencyLimits .ReachableResources , dispatchChunkSize )
110
- lookupResourcesHandler := graph .NewCursoredLookupResources (redispatcher , redispatcher , concurrencyLimits .LookupResources , dispatchChunkSize )
111
- lookupSubjectsHandler := graph .NewConcurrentLookupSubjects (redispatcher , concurrencyLimits .LookupSubjects , dispatchChunkSize )
112
- lookupResourcesHandler2 := graph .NewCursoredLookupResources2 (redispatcher , redispatcher , concurrencyLimits .LookupResources , dispatchChunkSize )
119
+ reachableResourcesHandler := graph .NewCursoredReachableResources (redispatcher , concurrencyLimits .ReachableResources , chunkSize )
120
+ lookupResourcesHandler := graph .NewCursoredLookupResources (redispatcher , redispatcher , concurrencyLimits .LookupResources , chunkSize )
121
+ lookupSubjectsHandler := graph .NewConcurrentLookupSubjects (redispatcher , concurrencyLimits .LookupSubjects , chunkSize )
122
+ lookupResourcesHandler2 := graph .NewCursoredLookupResources2 (redispatcher , redispatcher , concurrencyLimits .LookupResources , chunkSize )
113
123
114
124
return & localDispatcher {
115
125
checker : checker ,
0 commit comments