From bbae0aa3f15f9e0e13ec0a27648cb860af9a41ed Mon Sep 17 00:00:00 2001 From: Baha Aiman Date: Wed, 24 Apr 2024 12:15:09 -0700 Subject: [PATCH] refactor(datastore): Rename function (#10032) --- datastore/query.go | 4 ++-- datastore/transaction.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/datastore/query.go b/datastore/query.go index a949362bef2f..6acc6821e84f 100644 --- a/datastore/query.go +++ b/datastore/query.go @@ -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) @@ -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. diff --git a/datastore/transaction.go b/datastore/transaction.go index b35c6a31ce65..a8dd8149e1b6 100644 --- a/datastore/transaction.go +++ b/datastore/transaction.go @@ -224,7 +224,7 @@ func (t *Transaction) beginLaterTransaction() (err error) { return err } - t.startProgress(txnID) + t.setToInProgress(txnID) return nil } @@ -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 } @@ -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 @@ -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 }