From 90b9a665824003f2d6d0f6f980a38228bbd24fe8 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Wed, 28 Feb 2024 17:29:16 +0100 Subject: [PATCH] Shut down engines cleanly --- cmd/terraform_plan.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/terraform_plan.go b/cmd/terraform_plan.go index e396d976..2b4920c3 100644 --- a/cmd/terraform_plan.go +++ b/cmd/terraform_plan.go @@ -200,6 +200,7 @@ func TerraformPlan(ctx context.Context, files []string, ready chan bool) int { log.WithError(err).Error("failed to start AWS source engine") return 1 } + defer awsEngine.Stop() stdlibEngine, err := stdlibsource.InitializeStdlibSourceEngine(natsOptions, 2_000, true) if err != nil { @@ -213,6 +214,7 @@ func TerraformPlan(ctx context.Context, files []string, ready chan bool) int { log.WithError(err).Error("failed to start stdlib source engine") return 1 } + defer stdlibEngine.Stop() prompt := `# Doing something