MCPcopy
hub / github.com/pocketbase/pocketbase / OnComplete

Method OnComplete

core/db_tx.go:85–90  ·  view source on GitHub ↗

OnComplete registers the provided callback that will be invoked once the related transaction ends (either completes successfully or rollbacked with an error). The callback receives the transaction error (if any) as its argument. Any additional errors returned by the OnComplete callbacks will be joi

(fn func(txErr error) error)

Source from the content-addressed store, hash-verified

83// Any additional errors returned by the OnComplete callbacks will be
84// joined together with txErr when returning the final transaction result.
85func (a *TxAppInfo) OnComplete(fn func(txErr error) error) {
86 a.mu.Lock()
87 defer a.mu.Unlock()
88
89 a.afterFuncs = append(a.afterFuncs, fn)
90}
91
92// note: can be called only once because TxAppInfo is cleared
93func (a *TxAppInfo) runAfterFuncs(txErr error) error {

Callers 4

deleteMethod · 0.80
createMethod · 0.80
updateMethod · 0.80
execAfterSuccessTxFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected