Use post commit hook for post-create plugin hooks (#2920)

This commit is contained in:
WithoutPants
2022-09-19 14:53:06 +10:00
committed by GitHub
parent 0359ce2ed8
commit 2564351265
12 changed files with 109 additions and 88 deletions

View File

@@ -70,12 +70,12 @@ func NewDeleter() *Deleter {
// RegisterHooks registers post-commit and post-rollback hooks.
func (d *Deleter) RegisterHooks(ctx context.Context, mgr txn.Manager) {
mgr.AddPostCommitHook(ctx, func(ctx context.Context) error {
txn.AddPostCommitHook(ctx, func(ctx context.Context) error {
d.Commit()
return nil
})
mgr.AddPostRollbackHook(ctx, func(ctx context.Context) error {
txn.AddPostRollbackHook(ctx, func(ctx context.Context) error {
d.Rollback()
return nil
})