mirror of https://github.com/dtm-labs/dtm.git
csharpjavadistributed-transactionsdtmgogolangmicroservicenodejsphpdatabasesagaseatatcctransactiontransactionsxapythondistributed
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
794 B
29 lines
794 B
package busi
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/dtm-labs/dtm/dtmcli/dtmimp"
|
|
"github.com/dtm-labs/dtm/dtmutil"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// Startup startup the busi's grpc and http service
|
|
func Startup() *gin.Engine {
|
|
GrpcStartup()
|
|
return BaseAppStartup()
|
|
}
|
|
|
|
// PopulateDB populate example mysql data
|
|
func PopulateDB(skipDrop bool) {
|
|
resetXaData()
|
|
file := fmt.Sprintf("%s/busi.%s.sql", dtmutil.GetSQLDir(), BusiConf.Driver)
|
|
dtmutil.RunSQLScript(BusiConf, file, skipDrop)
|
|
file = fmt.Sprintf("%s/dtmcli.barrier.%s.sql", dtmutil.GetSQLDir(), BusiConf.Driver)
|
|
dtmutil.RunSQLScript(BusiConf, file, skipDrop)
|
|
_, err := RedisGet().FlushAll(context.Background()).Result() // redis barrier need clear
|
|
dtmimp.E2P(err)
|
|
SetRedisBothAccount(10000, 10000)
|
|
SetupMongoBarrierAndBusi()
|
|
}
|
|
|