File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -949,7 +949,7 @@ LEVEL = Info
949949
950950; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
951951; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
952- ; [service. qos]
952+ ; [qos]
953953; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
954954; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
955955; ; Enable request quality of service and load shedding.
Original file line number Diff line number Diff line change @@ -263,12 +263,7 @@ func loadServiceFrom(rootCfg ConfigProvider) {
263263 mustMapSetting (rootCfg , "service.explore" , & Service .Explore )
264264
265265 loadOpenIDSetting (rootCfg )
266-
267- qosSection := rootCfg .Section ("service.qos" )
268- Service .QoS .Enabled = qosSection .Key ("ENABLED" ).MustBool (false )
269- Service .QoS .MaxInFlightRequests = qosSection .Key ("MAX_INFLIGHT" ).MustInt (4 * runtime .NumCPU ())
270- Service .QoS .MaxWaitingRequests = qosSection .Key ("MAX_WAITING" ).MustInt (100 )
271- Service .QoS .TargetWaitTime = qosSection .Key ("TARGET_WAIT_TIME" ).MustDuration (50 * time .Millisecond )
266+ loadQosSetting (rootCfg )
272267}
273268
274269func loadOpenIDSetting (rootCfg ConfigProvider ) {
@@ -290,3 +285,11 @@ func loadOpenIDSetting(rootCfg ConfigProvider) {
290285 }
291286 }
292287}
288+
289+ func loadQosSetting (rootCfg ConfigProvider ) {
290+ sec := rootCfg .Section ("qos" )
291+ Service .QoS .Enabled = sec .Key ("ENABLED" ).MustBool (false )
292+ Service .QoS .MaxInFlightRequests = sec .Key ("MAX_INFLIGHT" ).MustInt (4 * runtime .NumCPU ())
293+ Service .QoS .MaxWaitingRequests = sec .Key ("MAX_WAITING" ).MustInt (100 )
294+ Service .QoS .TargetWaitTime = sec .Key ("TARGET_WAIT_TIME" ).MustDuration (50 * time .Millisecond )
295+ }
You can’t perform that action at this time.
0 commit comments