From 0066f0c4efc675855a6d38a15cfa2883572ea3e7 Mon Sep 17 00:00:00 2001 From: ryanfkeepers Date: Fri, 17 Mar 2023 12:32:48 -0600 Subject: [PATCH] add 10 day deadline to cli context --- src/cli/cli.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 051e859f6..a2f4c5a0b 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -5,6 +5,7 @@ import ( "os" "regexp" "strings" + "time" "github.com/spf13/cobra" "golang.org/x/exp/slices" @@ -147,7 +148,10 @@ func BuildCommandTree(cmd *cobra.Command) { // Handle builds and executes the cli processor. func Handle() { //nolint:forbidigo - ctx := config.Seed(context.Background()) + ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Hour*24*10)) + defer cancel() + + ctx = config.Seed(ctx) ctx = print.SetRootCmd(ctx, corsoCmd) observe.SeedWriter(ctx, print.StderrWriter(ctx), observe.PreloadFlags())