Skip to content

Commit

Permalink
Merge pull request #1063 from nanfengonline/fixTypo
Browse files Browse the repository at this point in the history
Fix typo Unknow -> Unknown
  • Loading branch information
francisoliverlee authored Oct 31, 2023
2 parents 49f0448 + 49eb1fc commit 8e701a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions examples/producer/transaction/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ func (dl *DemoListener) ExecuteLocalTransaction(msg *primitive.Message) primitiv
dl.localTrans.Store(msg.TransactionId, primitive.LocalTransactionState(status+1))

fmt.Printf("dl")
return primitive.UnknowState
return primitive.UnkonwnState
}

func (dl *DemoListener) CheckLocalTransaction(msg *primitive.MessageExt) primitive.LocalTransactionState {
fmt.Printf("%v msg transactionID : %v\n", time.Now(), msg.TransactionId)
v, existed := dl.localTrans.Load(msg.TransactionId)
if !existed {
fmt.Printf("unknow msg: %v, return Commit", msg)
fmt.Printf("unknown msg: %v, return Commit", msg)
return primitive.CommitMessageState
}
state := v.(primitive.LocalTransactionState)
Expand All @@ -68,8 +68,8 @@ func (dl *DemoListener) CheckLocalTransaction(msg *primitive.MessageExt) primiti
fmt.Printf("checkLocalTransaction ROLLBACK_MESSAGE: %v\n", msg)
return primitive.RollbackMessageState
case 3:
fmt.Printf("checkLocalTransaction unknow: %v\n", msg)
return primitive.UnknowState
fmt.Printf("checkLocalTransaction unknown: %v\n", msg)
return primitive.UnkonwnState
default:
fmt.Printf("checkLocalTransaction default COMMIT_MESSAGE: %v\n", msg)
return primitive.CommitMessageState
Expand Down
2 changes: 1 addition & 1 deletion primitive/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ type LocalTransactionState int
const (
CommitMessageState LocalTransactionState = iota + 1
RollbackMessageState
UnknowState
UnkonwnState
)

type TransactionListener interface {
Expand Down
4 changes: 2 additions & 2 deletions producer/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ func (tp *transactionProducer) SendMessageInTransaction(ctx context.Context, msg
if err != nil {
return nil, err
}
localTransactionState := primitive.UnknowState
localTransactionState := primitive.UnkonwnState
switch rsp.Status {
case primitive.SendOK:
if len(rsp.TransactionID) > 0 {
Expand Down Expand Up @@ -782,7 +782,7 @@ func (tp *transactionProducer) transactionState(state primitive.LocalTransaction
return primitive.TransactionCommitType
case primitive.RollbackMessageState:
return primitive.TransactionRollbackType
case primitive.UnknowState:
case primitive.UnkonwnState:
return primitive.TransactionNotType
default:
return primitive.TransactionNotType
Expand Down

0 comments on commit 8e701a5

Please sign in to comment.