From 44e59f8168dccb33ebea7ce169145ab5c5ee7542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BA=B2=E5=BC=BA?= Date: Fri, 22 Oct 2021 10:45:56 +0800 Subject: [PATCH] feat:modify some notes --- dtmcli/barrier.go | 3 ++- dtmsvr/api_grpc.go | 2 +- examples/base_grpc.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dtmcli/barrier.go b/dtmcli/barrier.go index dbc47f5..b0c7343 100644 --- a/dtmcli/barrier.go +++ b/dtmcli/barrier.go @@ -50,7 +50,7 @@ func insertBarrier(tx Tx, transType string, gid string, branchID string, branchT // Call 子事务屏障,详细介绍见 https://zhuanlan.zhihu.com/p/388444465 // tx: 本地数据库的事务对象,允许子事务屏障进行事务操作 -// bisiCall: 业务函数,仅在必要时被调用 +// busiCall: 业务函数,仅在必要时被调用 func (bb *BranchBarrier) Call(tx Tx, busiCall BusiFunc) (rerr error) { bb.BarrierID = bb.BarrierID + 1 bid := fmt.Sprintf("%02d", bb.BarrierID) @@ -70,6 +70,7 @@ func (bb *BranchBarrier) Call(tx Tx, busiCall BusiFunc) (rerr error) { BranchCancel: BranchTry, BranchCompensate: BranchAction, }[ti.BranchType] + originAffected, _ := insertBarrier(tx, ti.TransType, ti.Gid, ti.BranchID, originType, bid, ti.BranchType) currentAffected, rerr := insertBarrier(tx, ti.TransType, ti.Gid, ti.BranchID, ti.BranchType, bid, ti.BranchType) Logf("originAffected: %d currentAffected: %d", originAffected, currentAffected) diff --git a/dtmsvr/api_grpc.go b/dtmsvr/api_grpc.go index 3f392a2..074faf6 100644 --- a/dtmsvr/api_grpc.go +++ b/dtmsvr/api_grpc.go @@ -9,7 +9,7 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) -// dtmServer is used to implement helloworld.GreeterServer. +// dtmServer is used to implement dtmgrpc.DtmServer. type dtmServer struct { pb.UnimplementedDtmServer } diff --git a/examples/base_grpc.go b/examples/base_grpc.go index cf9c626..8b9f0d2 100644 --- a/examples/base_grpc.go +++ b/examples/base_grpc.go @@ -50,7 +50,7 @@ func handleGrpcBusiness(in *dtmgrpc.BusiRequest, result1 string, result2 string, return status.New(codes.Internal, fmt.Sprintf("unknow result %s", res)).Err() } -// busiServer is used to implement helloworld.GreeterServer. +// busiServer is used to implement examples.BusiServer. type busiServer struct { UnimplementedBusiServer }