This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 5235a974f feat(framework): skip to update progress of subtasks (#8154)
5235a974f is described below

commit 5235a974f1a3db9d8002c972413491c25df48392
Author: NaRro <[email protected]>
AuthorDate: Wed Oct 23 16:08:51 2024 +0800

    feat(framework): skip to update progress of subtasks (#8154)
    
    - 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 9a57d21c8..0a4bbcd8c 100644
--- a/backend/core/runner/run_task.go
+++ b/backend/core/runner/run_task.go
@@ -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},
        }
@@ -378,6 +381,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

Reply via email to