Commit implements Txn Commit interface.
()
| 38 | |
| 39 | // Commit implements Txn Commit interface. |
| 40 | func (t *slowLogTxn) Commit() (*clientv3.TxnResponse, error) { |
| 41 | start := time.Now() |
| 42 | resp, err := t.Txn.Commit() |
| 43 | t.cancel() |
| 44 | |
| 45 | cost := time.Now().Sub(start) |
| 46 | if cost > DefaultSlowRequestTime { |
| 47 | log.Warn("slow: txn runs too slow, resp=<%v> cost=<%s> errors:\n %+v", |
| 48 | resp, |
| 49 | cost, |
| 50 | err) |
| 51 | } |
| 52 | |
| 53 | return resp, err |
| 54 | } |
| 55 | |
| 56 | func (e *EtcdStore) txn() clientv3.Txn { |
| 57 | return newSlowLogTxn(e.rawClient) |
no outgoing calls
no test coverage detected