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

@@ -200,8 +200,8 @@ func (c Cache) ExecutePostHooks(ctx context.Context, id int, hookType HookTrigge
}
}
func (c Cache) RegisterPostHooks(ctx context.Context, txnMgr txn.Manager, id int, hookType HookTriggerEnum, input interface{}, inputFields []string) {
txnMgr.AddPostCommitHook(ctx, func(ctx context.Context) error {
func (c Cache) RegisterPostHooks(ctx context.Context, id int, hookType HookTriggerEnum, input interface{}, inputFields []string) {
txn.AddPostCommitHook(ctx, func(ctx context.Context) error {
c.ExecutePostHooks(ctx, id, hookType, input, inputFields)
return nil
})