MCPcopy Create free account
hub / github.com/cloudwan/gohan / tryToCommit

Function tryToCommit

db/db.go:74–81  ·  view source on GitHub ↗
(fn func(ITransaction) error)

Source from the content-addressed store, hash-verified

72}
73
74func tryToCommit(fn func(ITransaction) error) func(ITransaction) error {
75 return func(tx ITransaction) error {
76 if err := fn(tx); err != nil {
77 return err
78 }
79 return tx.Commit()
80 }
81}
82
83func tryWithinTx(
84 beginStrategy func() (ITransaction, error),

Callers 1

tryWithinTxFunction · 0.85

Calls 1

CommitMethod · 0.65

Tested by

no test coverage detected