Skip to content

Commit

Permalink
try to add brew test
Browse files Browse the repository at this point in the history
  • Loading branch information
yedf2 committed Dec 30, 2021
1 parent 852731a commit a441b6e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 45 deletions.
31 changes: 0 additions & 31 deletions Formula/dtm.rb

This file was deleted.

10 changes: 0 additions & 10 deletions helper/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,3 @@ builds:
main: main.go
ldflags:
- -s -w -X main.Version={{.Version}} -X main.Commit={{.Commit}} -X main.Date={{.Date}}
brews:
- homepage: 'https://d.dtm.pub'
description: 'A cross-language distributed transaction manager.'
folder: Formula
commit_author:
name: dtm-labs
email: [email protected]
tap:
owner: dtm-labs
name: dtm
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func usage() {
var isVersion = flag.Bool("v", false, "Show the version of dtm.")
var isDebug = flag.Bool("d", false, "Set log level to debug.")
var isHelp = flag.Bool("h", false, "Show the help information about etcd.")
var isReset = flag.Bool("r", false, "Reset dtm server data.")
var confFile = flag.String("c", "", "Path to the server configuration file.")

func main() {
Expand All @@ -64,6 +65,9 @@ func main() {
if *isDebug {
config.Config.LogLevel = "debug"
}
if *isReset {
dtmsvr.PopulateDB(false)
}
maxprocs.Set(maxprocs.Logger(logger.Infof))
registry.WaitStoreUp()
dtmsvr.StartSvr() // 启动dtmsvr的api服务
Expand Down
7 changes: 3 additions & 4 deletions qs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
package main

import (
"time"

"github.com/dtm-labs/dtm/dtmcli/logger"
"github.com/dtm-labs/dtm/test/busi"
)

func main() {
busi.QsStartSvr()
busi.QsFireRequest()
time.Sleep(1 * time.Second)
gid := busi.QsFireRequest()
logger.Infof("transaction: %s succeed", gid)
}
2 changes: 2 additions & 0 deletions test/busi/quick_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func QsFireRequest() string {
Add(qsBusi+"/TransOut", qsBusi+"/TransOutCompensate", req).
// 添加一个TransIn的子事务,正向操作为url: qsBusi+"/TransOut", 逆向操作为url: qsBusi+"/TransInCompensate"
Add(qsBusi+"/TransIn", qsBusi+"/TransInCompensate", req)
// 等待事务全部完成后再返回,可选
saga.WaitResult = true
// 提交saga事务,dtm会完成所有的子事务/回滚所有的子事务
err := saga.Submit()
logger.FatalIfError(err)
Expand Down

0 comments on commit a441b6e

Please sign in to comment.