keon94 commented on code in PR #5609:
URL:
https://github.com/apache/incubator-devlake/pull/5609#discussion_r1251080846
##########
backend/helpers/pluginhelper/api/scope_generic_helper.go:
##########
@@ -297,7 +300,24 @@ func (gs *GenericScopeApiHelper[Conn, Scope, ScopeConfig])
GetScope(input *plugi
return scopeRes, nil
}
-func (gs *GenericScopeApiHelper[Conn, Scope, ScopeConfig]) DeleteScope(input
*plugin.ApiResourceInput) (*serviceHelper.BlueprintProjectPairs, errors.Error) {
+func (gs *GenericScopeApiHelper[Conn, Scope, ScopeConfig]) DeleteScope(input
*plugin.ApiResourceInput) (refs *serviceHelper.BlueprintProjectPairs, err
errors.Error) {
+ txHelper := dbhelper.NewTxHelper(gs.basicRes, &err)
+ defer txHelper.End()
+ tx := txHelper.Begin()
+ err = txHelper.LockTablesTimeout(2*time.Second,
map[string]bool{"_devlake_pipelines": false})
Review Comment:
the pipeline locking and check should be its own function
`LockPipelines(...)`. Perhaps it can move to the helper package next to
BlueprintManager?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]