You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ly...@apache.org on 2024/07/24 08:12:35 UTC

(incubator-devlake) branch dev-1 created (now dc0adf8d4)

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

lynwee pushed a change to branch dev-1
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


      at dc0adf8d4 fix(webhook): rollback database when webhook's name is same

This branch includes the following new commits:

     new dc0adf8d4 fix(webhook): rollback database when webhook's name is same

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(incubator-devlake) 01/01: fix(webhook): rollback database when webhook's name is same

Posted by ly...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit dc0adf8d46af796269816547b2eea856d3b01d62
Author: d4x1 <15...@qq.com>
AuthorDate: Wed Jul 24 16:12:24 2024 +0800

    fix(webhook): rollback database when webhook's name is same
---
 backend/plugins/webhook/api/connection.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/backend/plugins/webhook/api/connection.go b/backend/plugins/webhook/api/connection.go
index f3c9e9116..93db8d9d9 100644
--- a/backend/plugins/webhook/api/connection.go
+++ b/backend/plugins/webhook/api/connection.go
@@ -44,6 +44,9 @@ func PostConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput,
 	tx := basicRes.GetDal().Begin()
 	err := connectionHelper.CreateWithTx(tx, connection, input)
 	if err != nil {
+		if err := tx.Rollback(); err != nil {
+			logger.Error(err, "transaction Rollback")
+		}
 		return nil, err
 	}
 	logger.Info("connection: %+v", connection)