diff --git a/internal/services/config/config.go b/internal/services/config/config.go index faf6e7c..04cb4b0 100644 --- a/internal/services/config/config.go +++ b/internal/services/config/config.go @@ -82,6 +82,8 @@ type RunServiceExecutor struct { Web Web `yaml:"web"` Labels map[string]string `yaml:"labels"` + // ActiveTasksLimit is the max number of concurrent active tasks + ActiveTasksLimit int `yaml:"active_tasks_limit"` } type ConfigStore struct { diff --git a/internal/services/runservice/executor/executor.go b/internal/services/runservice/executor/executor.go index 473a475..adfc25d 100644 --- a/internal/services/runservice/executor/executor.go +++ b/internal/services/runservice/executor/executor.go @@ -663,10 +663,11 @@ func (e *Executor) sendExecutorStatus(ctx context.Context) error { labels["arch"] = arch executor := &types.Executor{ - ID: e.id, - ListenURL: e.listenURL, - Labels: labels, - ActiveTasks: activeTasks, + ID: e.id, + ListenURL: e.listenURL, + Labels: labels, + ActiveTasksLimit: e.c.ActiveTasksLimit, + ActiveTasks: activeTasks, } log.Debugf("send executor status: %s", util.Dump(executor)) diff --git a/internal/services/runservice/types/types.go b/internal/services/runservice/types/types.go index 860ff82..c8ac433 100644 --- a/internal/services/runservice/types/types.go +++ b/internal/services/runservice/types/types.go @@ -658,7 +658,8 @@ type Executor struct { Labels map[string]string `json:"labels,omitempty"` - ActiveTasks int `json:"active_tasks,omitempty"` + ActiveTasksLimit int `json:"active_tasks_limit,omitempty"` + ActiveTasks int `json:"active_tasks,omitempty"` // internal values not saved Revision int64 `json:"-"`