From 30a14284788936366bb1b48383bbd47205cac728 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 6 Jun 2022 14:17:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/ai_model_convert.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/routers/repo/ai_model_convert.go b/routers/repo/ai_model_convert.go index ddf04b2c4..78e8c6ac5 100644 --- a/routers/repo/ai_model_convert.go +++ b/routers/repo/ai_model_convert.go @@ -76,10 +76,16 @@ func SaveModelConvert(ctx *context.Context) { UserId: ctx.User.ID, } models.SaveModelConvert(modelConvert) - createTrainJob(modelConvert, ctx, task.Path) - ctx.JSON(200, map[string]string{ - "result_code": "0", - }) + err = createTrainJob(modelConvert, ctx, task.Path) + if err == nil { + ctx.JSON(200, map[string]string{ + "result_code": "0", + }) + } else { + ctx.JSON(200, map[string]string{ + "result_code": "1", + }) + } } func createTrainJob(modelConvert *models.AiModelConvert, ctx *context.Context, modelRelativePath string) error {