Skip to content

Commit

Permalink
add context with timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
haitham911 committed Oct 20, 2024
1 parent f27f4d5 commit d0e1ec9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/exec/validate_stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"path"
"reflect"
"strings"
"time"

"github.com/hashicorp/go-getter"
"github.com/pkg/errors"
Expand Down Expand Up @@ -96,8 +97,10 @@ func ValidateStacks(cliConfig schema.CliConfiguration) error {
return fmt.Errorf("failed to get the file name from the URL '%s': %w", cliConfig.Schemas.Atmos.Manifest, err)
}
atmosManifestJsonSchemaFilePath = path.Join(tempDir, fileName)
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
client := &getter.Client{
Ctx: context.Background(),
Ctx: ctx,
Dst: atmosManifestJsonSchemaFilePath,
Src: cliConfig.Schemas.Atmos.Manifest,
Mode: getter.ClientModeFile,
Expand Down

0 comments on commit d0e1ec9

Please sign in to comment.