From 2864ca5e1c24eeb493c62e82a7dedac54320d7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 21 Mar 2024 20:32:40 +0000 Subject: [PATCH] oops --- flow/connectors/kafka/kafka.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/connectors/kafka/kafka.go b/flow/connectors/kafka/kafka.go index ff491ddc8c..b879e31def 100644 --- a/flow/connectors/kafka/kafka.go +++ b/flow/connectors/kafka/kafka.go @@ -164,7 +164,6 @@ func loadScript(ctx context.Context, script string, printfn lua.LGFunction) (*lu } ls := lua.NewState(lua.Options{SkipOpenLibs: true}) - defer ls.Close() ls.SetContext(ctx) for _, pair := range []struct { n string @@ -270,6 +269,7 @@ func (c *KafkaConnector) SyncRecords(ctx context.Context, req *model.SyncRecords if err != nil { return nil, err } + defer ls.Close() lfn := ls.Env.RawGetString("onRecord") fn, ok := lfn.(*lua.LFunction)