From 3995b28fe3e5b16581b230a11dc6dee8220c1c6d Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Sat, 16 Nov 2024 00:35:33 -0600 Subject: [PATCH] feat: Add a timeout to each cron run --- cmd/cmd.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index d532940..f40b5d0 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -68,7 +68,9 @@ func run(cmd *cobra.Command, args []string) error { ticker := time.NewTicker(conf.Every) for range ticker.C { - domains.Tick(cmd.Context(), integrations) + ctx, cancel := context.WithTimeout(cmd.Context(), conf.Every) + domains.Tick(ctx, integrations) + cancel() } }