likyh commented on code in PR #3943:
URL:
https://github.com/apache/incubator-devlake/pull/3943#discussion_r1049391763
##########
services/init.go:
##########
@@ -50,28 +49,23 @@ const failToCreateCronJob = "created cron job failed"
// Init the services module
func Init() {
var err error
- // basic resources initialization
cfg = config.GetConfig()
log = logger.Global
- db, err = runner.NewGormDb(cfg, logger.Global.Nested("db"))
- if err != nil {
- panic(err)
- }
- // gorm doesn't support creating a PrepareStmt=false session from a
PrepareStmt=true
- // but the lockDatabase needs PrepareStmt=false for table locking, we
have to deal with it here
- lockingDb, err := runner.NewGormDbEx(cfg,
logger.Global.Nested("migrator db"), &dal.SessionConfig{
- PrepareStmt: false,
- SkipDefaultTransaction: true,
- })
- if err != nil {
- panic(err)
- }
- err = lockDatabase(dalgorm.NewDalgorm(lockingDb))
+ db, err = runner.NewGormDb(cfg, log)
+ print("init db", db)
Review Comment:
use logger?
--
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]