From 0a42efcff42bc7487a84b90327eef12e0637e72d Mon Sep 17 00:00:00 2001 From: shiv Date: Wed, 18 Dec 2024 15:39:46 -0800 Subject: [PATCH 1/2] Change chained hooks nil check to correct function `PostRead` --> `PostReadImmediate` --- lifecycle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lifecycle.go b/lifecycle.go index 44bd69e..c3f4901 100644 --- a/lifecycle.go +++ b/lifecycle.go @@ -110,7 +110,7 @@ func ChainLifecycleHooks(hooks ...LifecycleHooks) LifecycleHooks { }, PostReadImmediate: func(ctx context.Context, meta LifecyclePostReadImmediateMeta) { for _, h := range hooks { - if h.PostRead != nil { + if h.PostReadImmediate != nil { h.PostReadImmediate(ctx, meta) } } From c38fac16b996930e8be368a350ac8add8729e1ad Mon Sep 17 00:00:00 2001 From: shiv Date: Wed, 18 Dec 2024 16:07:18 -0800 Subject: [PATCH 2/2] Fix other nil checks --- lifecycle.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lifecycle.go b/lifecycle.go index c3f4901..d31f083 100644 --- a/lifecycle.go +++ b/lifecycle.go @@ -168,7 +168,7 @@ func ChainLifecycleHooks(hooks ...LifecycleHooks) LifecycleHooks { Headers: make(map[string][]byte), } for _, h := range hooks { - if h.PreProcessing != nil { + if h.PreWrite != nil { var err error resp, err := h.PreWrite(ctx, meta) @@ -185,7 +185,7 @@ func ChainLifecycleHooks(hooks ...LifecycleHooks) LifecycleHooks { }, PostFanout: func(ctx context.Context) { for _, h := range hooks { - if h.PostRead != nil { + if h.PostFanout != nil { h.PostFanout(ctx) } }