This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch release-v1.0
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v1.0 by this push:
new b17c35b69 feat(framework): skip to update progress of subtasks (#8155)
b17c35b69 is described below
commit b17c35b6966652813fec685212de8433a3931488
Author: NaRro <[email protected]>
AuthorDate: Wed Oct 23 16:10:07 2024 +0800
feat(framework): skip to update progress of subtasks (#8155)
- add env SKIP_SUBTASK_PROGRESS to decide wether skip subtask progress
updating to db
---
backend/core/runner/run_task.go | 6 ++++++
env.example | 2 ++
2 files changed, 8 insertions(+)
diff --git a/backend/core/runner/run_task.go b/backend/core/runner/run_task.go
index 8a3515768..84f322c7a 100644
--- a/backend/core/runner/run_task.go
+++ b/backend/core/runner/run_task.go
@@ -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},
}
@@ -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%
diff --git a/env.example b/env.example
index b45799356..44604913a 100755
--- a/env.example
+++ b/env.example
@@ -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