You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by zh...@apache.org on 2022/09/29 10:41:39 UTC

[incubator-devlake] branch main updated: fix: tasks api 504 when pipeline is running (#3256)

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

zhangliang2022 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 a5f66029 fix: tasks api 504 when pipeline is running (#3256)
a5f66029 is described below

commit a5f6602976d6150153780b6f9e288f6a4cb4e636
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Thu Sep 29 18:41:33 2022 +0800

    fix: tasks api 504 when pipeline is running (#3256)
---
 services/task.go | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/services/task.go b/services/task.go
index 232db101..43b77cf4 100644
--- a/services/task.go
+++ b/services/task.go
@@ -280,16 +280,15 @@ func runTaskStandalone(parentLog core.Logger, taskId uint64) errors.Error {
 }
 
 func updateTaskProgress(taskId uint64, progress chan core.RunningProgress) {
-	runningTasks.mu.Lock()
-	defer runningTasks.mu.Unlock()
-
 	data := runningTasks.tasks[taskId]
 	if data == nil {
 		return
 	}
 	progressDetail := data.ProgressDetail
 	for p := range progress {
+		runningTasks.mu.Lock()
 		runner.UpdateProgressDetail(db, log, taskId, progressDetail, &p)
+		runningTasks.mu.Unlock()
 	}
 }