You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2022/10/08 07:56:58 UTC

[incubator-eventmesh] branch master updated: modify queue handle logic: add update task instance status

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

mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new d6e450ee modify queue handle logic: add update task instance status
     new 94ba873d Merge pull request #1482 from walterlife/modify-eventmesh-workflow-queue
d6e450ee is described below

commit d6e450ee7140a952ee50b77c6b67a88b73735dee
Author: walterlife <wa...@gmail.com>
AuthorDate: Sat Oct 1 23:45:40 2022 +0800

    modify queue handle logic:
    add update task instance status
---
 eventmesh-workflow-go/internal/queue/in_memory_queue.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/eventmesh-workflow-go/internal/queue/in_memory_queue.go b/eventmesh-workflow-go/internal/queue/in_memory_queue.go
index 931654bd..1c635c41 100644
--- a/eventmesh-workflow-go/internal/queue/in_memory_queue.go
+++ b/eventmesh-workflow-go/internal/queue/in_memory_queue.go
@@ -80,6 +80,12 @@ func (q *inMemoryQueue) handle(item rxgo.Item) {
 		return
 	}
 	log.Get(constants.LogQueue).Infof("handle=%s", gconv.String(v))
+	if v.ID != 0 {
+		if err := q.workflowDAL.UpdateTaskInstance(dal.GetDalClient(), v); err != nil {
+			log.Get(constants.LogQueue).Errorf("Observe UpdateTaskInstance error=%v", err)
+		}
+		return
+	}
 	if err := q.workflowDAL.InsertTaskInstance(context.Background(), v); err != nil {
 		log.Get(constants.LogQueue).Errorf("Observe InsertTaskInstance error=%v", err)
 	}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org