Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbailey committed Sep 18, 2020
1 parent 72a69c4 commit 7991cc2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nomad/state/state_changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ func (c *changeTrackerDB) WriteTxnRestore() *txn {
// error. Any errors from the callback would be lost, which would result in a
// missing change event, even though the state store had changed.
type txn struct {
// ctx is used to hold message type information from an FSM request
ctx context.Context

*memdb.Txn
// Index in raft where the write is occurring. The value is zero for a
// read-only, or WriteTxnRestore transaction.
Expand Down Expand Up @@ -166,6 +168,9 @@ func (tx *txn) Commit() error {
return nil
}

// MsgType returns a MessageType from the txn's context.
// If the context is empty or the value isn't set IgnoreUnknownTypeFlag will
// be returned to signal that the MsgType is unknown.
func (tx *txn) MsgType() structs.MessageType {
if tx.ctx == nil {
return structs.IgnoreUnknownTypeFlag
Expand Down

0 comments on commit 7991cc2

Please sign in to comment.