Browse Source

提交代码。删除任务之后释放资源。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.7.1
zouap 3 years ago
parent
commit
cfa3b7bdee
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      routers/repo/ai_model_convert.go

+ 2
- 0
routers/repo/ai_model_convert.go View File

@@ -534,12 +534,14 @@ func DeleteModelConvert(ctx *context.Context) {

func deleteCloudBrainTask(task *models.AiModelConvert) {
if task.IsGpuTrainTask() {
log.Info("delete cloudbrain one resource.")
dirPath := setting.CBCodePathPrefix + task.ID + "/"
err := storage.Attachments.DeleteDir(dirPath)
if err != nil {
log.Error("DeleteDir(%s) failed:%v", dirPath, err)
}
} else {
log.Info("delete cloudbrain two resource.")
_, err := modelarts.DelTrainJob(task.CloudBrainTaskId)
if err != nil {
log.Error("DelTrainJob(%s) failed:%v", task.CloudBrainTaskId, err.Error())


Loading…
Cancel
Save