MCPcopy
hub / github.com/grafana/dskit / Commit

Method Commit

kv/etcd/mock.go:490–501  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

488}
489
490func (m *mockTxn) Commit() (*clientv3.TxnResponse, error) {
491 op := clientv3.OpTxn(m.cmps, m.thenOps, m.elseOps)
492 // Note that we're using the Do method here instead of doInternal since we didn't
493 // acquire the data lock when starting this transaction.
494 res, err := m.kv.Do(m.ctx, op)
495
496 if err != nil {
497 return nil, err
498 }
499
500 return res.Txn(), nil
501}

Callers 2

CASMethod · 0.80
TestMockKV_TxnFunction · 0.80

Calls 2

TxnMethod · 0.80
DoMethod · 0.45

Tested by 1

TestMockKV_TxnFunction · 0.64