You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "mindlesscloud (via GitHub)" <gi...@apache.org> on 2023/03/20 06:00:28 UTC

[GitHub] [incubator-devlake] mindlesscloud commented on a diff in pull request #4710: fix: add db close connection

mindlesscloud commented on code in PR #4710:
URL: https://github.com/apache/incubator-devlake/pull/4710#discussion_r1141658771


##########
backend/plugins/starrocks/tasks/tasks.go:
##########
@@ -414,6 +419,11 @@ func getDbInstance(c plugin.SubTaskContext) (db dal.Dal, err error) {
 			return nil, errors.NotFound.New(fmt.Sprintf("unsupported source type %s", config.SourceType))
 		}
 		db = dalgorm.NewDalgorm(o)
+		sqlDB, err := o.DB()
+		if err != nil {
+			return nil, err
+		}
+		defer sqlDB.Close()

Review Comment:
   the connection will be closed when the function `getDbInstance` returns



-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org