Browse Source

提交代码

fix-2251
ychao_1983 2 years ago
parent
commit
cb23d9c64b
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      services/cloudbrain/clear.go

+ 3
- 0
services/cloudbrain/clear.go View File

@@ -27,6 +27,7 @@ func ClearCloudbrainResultSpace() {
for _, task := range tasks { for _, task := range tasks {
err := DeleteCloudbrainOneJobStorage(task.JobName) err := DeleteCloudbrainOneJobStorage(task.JobName)
if err == nil { if err == nil {
log.Info("clear job in cloudbrain table:"+task.JobName)
ids = append(ids, task.ID) ids = append(ids, task.ID)
} }
} }
@@ -58,6 +59,7 @@ func clearMinioHistoryTrashFile() {


if file.ModTime().Before(time.Now().AddDate(0, 0, -setting.ClearStrategy.TrashSaveDays)) { if file.ModTime().Before(time.Now().AddDate(0, 0, -setting.ClearStrategy.TrashSaveDays)) {
dirPath := setting.CBCodePathPrefix + file.Name() + "/" dirPath := setting.CBCodePathPrefix + file.Name() + "/"
log.Info("clear job in minio trash:"+file.Name())
storage.Attachments.DeleteDir(dirPath) storage.Attachments.DeleteDir(dirPath)
processCount++ processCount++
if processCount == setting.ClearStrategy.BatchSize { if processCount == setting.ClearStrategy.BatchSize {
@@ -83,6 +85,7 @@ func clearLocalHistoryTrashFile() {
//清理n天前的历史垃圾数据,清理job目录 //清理n天前的历史垃圾数据,清理job目录
if file.ModTime().Before(time.Now().AddDate(0, 0, -setting.ClearStrategy.TrashSaveDays)) { if file.ModTime().Before(time.Now().AddDate(0, 0, -setting.ClearStrategy.TrashSaveDays)) {
os.RemoveAll(setting.JobPath + file.Name()) os.RemoveAll(setting.JobPath + file.Name())
log.Info("clear job in local trash:"+file.Name())
processCount++ processCount++
if processCount == setting.ClearStrategy.BatchSize { if processCount == setting.ClearStrategy.BatchSize {
break break


Loading…
Cancel
Save