File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ package bl
1919
2020import (
2121 "errors"
22+ "strconv"
2223 "time"
24+ "vermeer/apps/common"
2325 "vermeer/apps/master/schedules"
2426 "vermeer/apps/structure"
2527
@@ -36,7 +38,16 @@ type ScheduleBl struct {
3638}
3739
3840func (s * ScheduleBl ) Init () {
39- startChan := make (chan * structure.TaskInfo , 10 ) // TODO: make configurable
41+ const defaultChanSizeConfig = "10"
42+ chanSize := common .GetConfigDefault ("start_chan_size" , defaultChanSizeConfig ).(string )
43+ // Convert string to int
44+ chanSizeInt , err := strconv .Atoi (chanSize )
45+ if err != nil {
46+ logrus .Errorf ("failed to convert start_chan_size to int: %v" , err )
47+ logrus .Infof ("using default start_chan_size: %s" , defaultChanSizeConfig )
48+ chanSizeInt , _ = strconv .Atoi (defaultChanSizeConfig )
49+ }
50+ startChan := make (chan * structure.TaskInfo , chanSizeInt )
4051 s .startChan = startChan
4152 s .spaceQueue = (& schedules.SpaceQueue {}).Init ()
4253 s .broker = (& schedules.Broker {}).Init ()
Original file line number Diff line number Diff line change @@ -23,4 +23,5 @@ run_mode=master
2323task_strategy =1
2424task_parallel_num =1
2525auth =none
26- auth_token_factor =1234
26+ auth_token_factor =1234
27+ start_chan_size =10
You can’t perform that action at this time.
0 commit comments