mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-12-15 16:16:44 +00:00
[bugfix] support switch scheduler.strategy
This commit is contained in:
11
src/main.go
11
src/main.go
@@ -321,6 +321,14 @@ func serverAPI(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
|
||||||
|
/* scheduler.strategy */
|
||||||
|
/* TODO: move jobs */
|
||||||
|
case "scheduler.strategy":
|
||||||
|
ok = InstanceOfConfiguration().SetSchedulePolicy(value)
|
||||||
|
scheduler = InstanceOfConfiguration().GetScheduler()
|
||||||
|
scheduler.Start()
|
||||||
|
break
|
||||||
|
|
||||||
/* scheduler.mock */
|
/* scheduler.mock */
|
||||||
case "scheduler.mock.enabled":
|
case "scheduler.mock.enabled":
|
||||||
ok = InstanceOfConfiguration().SetMockEnabled(value == "true")
|
ok = InstanceOfConfiguration().SetMockEnabled(value == "true")
|
||||||
@@ -344,11 +352,8 @@ func serverAPI(w http.ResponseWriter, r *http.Request) {
|
|||||||
break
|
break
|
||||||
|
|
||||||
/* allocator.strategy */
|
/* allocator.strategy */
|
||||||
/* TODO: move jobs */
|
|
||||||
case "allocator.strategy":
|
case "allocator.strategy":
|
||||||
ok = InstanceOfAllocator().updateStrategy(value)
|
ok = InstanceOfAllocator().updateStrategy(value)
|
||||||
scheduler = InstanceOfConfiguration().GetScheduler()
|
|
||||||
scheduler.Start()
|
|
||||||
break
|
break
|
||||||
|
|
||||||
/* logger */
|
/* logger */
|
||||||
|
|||||||
Reference in New Issue
Block a user