Skip to content

Commit

Permalink
feat(framework): skip to update progress of subtasks
Browse files Browse the repository at this point in the history
- add env SKIP_SUBTASK_PROGRESS to decide wether skip subtask progress updating to db

#8142
  • Loading branch information
narrowizard committed Oct 23, 2024
1 parent f0bb123 commit c7555bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/core/runner/run_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ func RunPluginSubTasks(

// UpdateProgressDetail FIXME ...
func UpdateProgressDetail(basicRes context.BasicRes, taskId uint64, progressDetail *models.TaskProgressDetail, p *plugin.RunningProgress) {
cfg := basicRes.GetConfigReader()
skipSubtaskProgressUpdate := cfg.GetBool("SKIP_SUBTASK_PROGRESS")

task := &models.Task{
Model: common.Model{ID: taskId},
}
Expand Down Expand Up @@ -378,6 +381,10 @@ func UpdateProgressDetail(basicRes context.BasicRes, taskId uint64, progressDeta
// reset finished records
progressDetail.FinishedRecords = 0
}
if skipSubtaskProgressUpdate {
basicRes.GetLogger().Info("skip subtask progress update")
return
}
currentFinishedRecords := progressDetail.FinishedRecords
currentTotalRecords := progressDetail.TotalRecords
// update progress if progress is more than 1%
Expand Down
2 changes: 2 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ DB_URL=mysql://merico:merico@mysql:3306/lake?charset=utf8mb4&parseTime=True&loc=
E2E_DB_URL=mysql://merico:merico@mysql:3306/lake_test?charset=utf8mb4&parseTime=True&loc=UTC
# Silent Error Warn Info
DB_LOGGING_LEVEL=Error
# Skip to update progress of subtasks, default is false (#8142)
SKIP_SUBTASK_PROGRESS=false

# Lake REST API
PORT=8080
Expand Down

0 comments on commit c7555bc

Please sign in to comment.