1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-16 00:26:43 +00:00

set parallelism

This commit is contained in:
2020-04-13 23:53:38 +08:00
parent 490a6b3928
commit ca3ac7aea1
6 changed files with 44 additions and 5 deletions

View File

@@ -13,8 +13,9 @@ type SchedulerFCFS struct {
mu sync.Mutex
scheduling sync.Mutex
jobs map[string]*JobManager
enabled bool
jobs map[string]*JobManager
enabled bool
parallelism int
}
func (scheduler *SchedulerFCFS) Start() {
@@ -254,3 +255,9 @@ func (scheduler *SchedulerFCFS) Disable() bool {
scheduler.enabled = false
return true
}
func (scheduler *SchedulerFCFS) UpdateParallelism(parallelism int) bool {
scheduler.parallelism = parallelism
log.Info("parallelism is updated to", parallelism)
return true
}