|
|
@@ -27,6 +27,7 @@ func ClearCloudbrainResultSpace() { |
|
|
|
for _, task := range tasks { |
|
|
|
err := DeleteCloudbrainOneJobStorage(task.JobName) |
|
|
|
if err == nil { |
|
|
|
log.Info("clear job in cloudbrain table:"+task.JobName) |
|
|
|
ids = append(ids, task.ID) |
|
|
|
} |
|
|
|
} |
|
|
@@ -58,6 +59,7 @@ func clearMinioHistoryTrashFile() { |
|
|
|
|
|
|
|
if file.ModTime().Before(time.Now().AddDate(0, 0, -setting.ClearStrategy.TrashSaveDays)) { |
|
|
|
dirPath := setting.CBCodePathPrefix + file.Name() + "/" |
|
|
|
log.Info("clear job in minio trash:"+file.Name()) |
|
|
|
storage.Attachments.DeleteDir(dirPath) |
|
|
|
processCount++ |
|
|
|
if processCount == setting.ClearStrategy.BatchSize { |
|
|
@@ -83,6 +85,7 @@ func clearLocalHistoryTrashFile() { |
|
|
|
//清理n天前的历史垃圾数据,清理job目录 |
|
|
|
if file.ModTime().Before(time.Now().AddDate(0, 0, -setting.ClearStrategy.TrashSaveDays)) { |
|
|
|
os.RemoveAll(setting.JobPath + file.Name()) |
|
|
|
log.Info("clear job in local trash:"+file.Name()) |
|
|
|
processCount++ |
|
|
|
if processCount == setting.ClearStrategy.BatchSize { |
|
|
|
break |
|
|
|