Skip to content

Commit

Permalink
refactor(datastore): Rename function (#10032)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhshkh authored Apr 24, 2024
1 parent 4067f4e commit bbae0aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions datastore/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ func (c *Client) RunAggregationQuery(ctx context.Context, aq *AggregationQuery)
}

if txn != nil && txn.state == transactionStateNotStarted {
txn.startProgress(res.Transaction)
txn.setToInProgress(res.Transaction)
}

ar = make(AggregationResult)
Expand Down Expand Up @@ -979,7 +979,7 @@ func (t *Iterator) nextBatch() error {
}

if txn != nil && txn.state == transactionStateNotStarted {
txn.startProgress(resp.Transaction)
txn.setToInProgress(resp.Transaction)
}

// Adjust any offset from skipped results.
Expand Down
8 changes: 4 additions & 4 deletions datastore/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (t *Transaction) beginLaterTransaction() (err error) {
return err
}

t.startProgress(txnID)
t.setToInProgress(txnID)
return nil
}

Expand All @@ -241,7 +241,7 @@ func (t *Transaction) acquireLock() func() {
return func() {}
}

func (t *Transaction) startProgress(id []byte) {
func (t *Transaction) setToInProgress(id []byte) {
t.id = id
t.state = transactionStateInProgress
}
Expand All @@ -262,7 +262,7 @@ func (c *Client) newTransaction(ctx context.Context, s *transactionSettings) (_
if err != nil {
return nil, err
}
t.startProgress(txnID)
t.setToInProgress(txnID)
}

return t, nil
Expand Down Expand Up @@ -427,7 +427,7 @@ func (t *Transaction) get(spanName string, keys []*Key, dst interface{}) (err er
txnID, err := t.client.get(t.ctx, keys, dst, opts)

if txnID != nil && err == nil {
t.startProgress(txnID)
t.setToInProgress(txnID)
}
return err
}
Expand Down

0 comments on commit bbae0aa

Please sign in to comment.