@@ -2,6 +2,8 @@ package models_train
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/models/utils"
|
||||
. "git.andr3h3nriqu3s.com/andr3/fyp/logic/utils"
|
||||
@@ -40,11 +42,13 @@ func handleRest(handle *Handle) {
|
||||
return Error500(err)
|
||||
}
|
||||
|
||||
if model.Status != FAILED_PREPARING_TRAINING {
|
||||
if model.Status != FAILED_PREPARING_TRAINING && model.Status != FAILED_TRAINING {
|
||||
// TODO improve response
|
||||
return ErrorCode(nil, 400, c.AddMap(nil))
|
||||
}
|
||||
|
||||
os.RemoveAll(path.Join("savedData", model.Id, "defs"))
|
||||
|
||||
_, err = handle.Db.Exec("delete from model_definition where model_id=$1", model.Id)
|
||||
if err != nil {
|
||||
// TODO improve response
|
||||
|
||||
Reference in New Issue
Block a user