From 885b448546bf764397a57f4dacdecbc6d752fd76 Mon Sep 17 00:00:00 2001 From: TP Honey Date: Mon, 16 Dec 2024 15:28:37 +0000 Subject: [PATCH] dont wait forever revlink warmup, wait 20 seconds --- cmd/terraform_plan.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd/terraform_plan.go b/cmd/terraform_plan.go index ff72bf0..e8cfd02 100644 --- a/cmd/terraform_plan.go +++ b/cmd/terraform_plan.go @@ -178,9 +178,18 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI resourceExtractionSpinner.Success() // wait for the revlink warmup to finish before we update the planned changes - err = revlinkPool.Wait() - if err != nil { - return fmt.Errorf("error waiting for revlink warmup: %w", err) + waitCh := make(chan error, 1) + go func() { + waitCh <- revlinkPool.Wait() + }() + + select { + case err = <-waitCh: + if err != nil { + return fmt.Errorf("error waiting for revlink warmup: %w", err) + } + case <-time.After(20 * time.Second): + log.Warn("revlink warmup timed out") } ///////////////////////////////////////////////////////////////////