Skip to content

Commit

Permalink
feat(framework): skip to update progress of subtasks (#8155)
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
  • Loading branch information
narrowizard authored Oct 23, 2024
1 parent 48dd544 commit b17c35b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/core/runner/run_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,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 @@ -377,6 +380,9 @@ func UpdateProgressDetail(basicRes context.BasicRes, taskId uint64, progressDeta
// reset finished records
progressDetail.FinishedRecords = 0
}
if skipSubtaskProgressUpdate {
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 b17c35b

Please sign in to comment.