Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion vermeer/apps/master/bl/scheduler_bl.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ package bl

import (
"errors"
"strconv"
"time"
"vermeer/apps/common"
"vermeer/apps/master/schedules"
"vermeer/apps/structure"

Expand All @@ -36,7 +38,16 @@ type ScheduleBl struct {
}

func (s *ScheduleBl) Init() {
startChan := make(chan *structure.TaskInfo, 10) // TODO: make configurable
const defaultChanSizeConfig = "10"
chanSize := common.GetConfigDefault("start_chan_size", defaultChanSizeConfig).(string)
// Convert string to int
chanSizeInt, err := strconv.Atoi(chanSize)
if err != nil {
logrus.Errorf("failed to convert start_chan_size to int: %v", err)
logrus.Infof("using default start_chan_size: %s", defaultChanSizeConfig)
chanSizeInt, _ = strconv.Atoi(defaultChanSizeConfig)
}
startChan := make(chan *structure.TaskInfo, chanSizeInt)
s.startChan = startChan
s.spaceQueue = (&schedules.SpaceQueue{}).Init()
s.broker = (&schedules.Broker{}).Init()
Expand Down
3 changes: 2 additions & 1 deletion vermeer/config/master.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ run_mode=master
task_strategy=1
task_parallel_num=1
auth=none
auth_token_factor=1234
auth_token_factor=1234
Copy link

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a descriptive comment for start_chan_size in master.ini to explain its purpose and valid values.

Suggested change
auth_token_factor=1234
auth_token_factor=1234
; The initial size of the channel buffer used for communication between components.
; Valid values: Any positive integer. A larger value may improve performance for high-throughput systems.

Copilot uses AI. Check for mistakes.
start_chan_size=10
Loading