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:36 UTC
(incubator-devlake) 01/01: fix(webhook): rollback database when webhook's name is same
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)