Skip to content

Commit

Permalink
feat: Add a timeout to each cron run
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Nov 16, 2024
1 parent af04d18 commit 3995b28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit 3995b28

Please sign in to comment.