From 0a81adea2297c7988f180d38536a9f5326ddccd1 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)