Reapply "feat(loyalty): EnakPoint & EnakCoin" (#32)
This reverts commit 4e24f9bbb0.
This commit is contained in:
@@ -50,3 +50,10 @@ func (m *TxManager) WithTransactionOptions(ctx context.Context, opts *sql.TxOpti
|
||||
return fn(ctxTx)
|
||||
}, opts)
|
||||
}
|
||||
|
||||
// DetachTransaction returns ctx without the caller's transaction, so work started from
|
||||
// it (such as loyalty earning after a payment) reads committed data and commits on its
|
||||
// own, whatever happens to the caller's transaction.
|
||||
func DetachTransaction(ctx context.Context) context.Context {
|
||||
return context.WithValue(ctx, txKey, (*gorm.DB)(nil))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user