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

add dockerfile

This commit is contained in:
2019-04-16 15:33:37 +08:00
parent 5877310950
commit e34d75dc7f
5 changed files with 23 additions and 11 deletions

View File

@@ -37,14 +37,15 @@ func serverAPI(w http.ResponseWriter, r *http.Request) {
case "job_submit":
var job Job
fmt.Println("job_submit")
msgSubmit := MsgSubmit{Code: 0}
err := json.Unmarshal([]byte(string(r.PostFormValue("job"))), &job)
if err != nil {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(err.Error()))
return
msgSubmit.Code = 1
msgSubmit.Error = err.Error()
} else {
allocator.schedule(job)
}
allocator.schedule(job)
js, _ := json.Marshal(nodes)
js, _ := json.Marshal(msgSubmit)
w.Header().Set("Content-Type", "application/json")
w.Write(js)
break