1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-16 00:26:43 +00:00
This commit is contained in:
2020-04-13 18:37:54 +08:00
parent cb6dabb41f
commit 3f215b0e1d
5 changed files with 19 additions and 10 deletions

View File

@@ -19,6 +19,7 @@ type SchedulerPriority struct {
func (scheduler *SchedulerPriority) Start() {
scheduler.jobs = map[string]*JobManager{}
scheduler.history = []*Job{}
scheduler.enabled = true
go func() {
for {
@@ -253,10 +254,12 @@ func (scheduler *SchedulerPriority) Detach(GPU string, job string) {
pool.detach(GPU, job)
}
func (scheduler *SchedulerPriority) Enable() {
func (scheduler *SchedulerPriority) Enable() bool {
scheduler.enabled = true
return true
}
func (scheduler *SchedulerPriority) Disable() {
func (scheduler *SchedulerPriority) Disable() bool {
scheduler.enabled = false
return true
}