What's New
- New method WithContext supports providing a parent context by @27149chen in https://github.com/go-co-op/gocron/pull/819 & @JohnRoesler in https://github.com/go-co-op/gocron/pull/820
// WithContext sets the parent context for the job.
// If you set the first argument of your Task func to be a context.Context,
// gocron will pass in the provided context to the job and will cancel the
// context on shutdown. If you cancel the context the job will no longer be
// scheduled as well. This allows you to both control the job via a context
// and listen for and handle cancellation within your job.- Job task function now supports passing a ctx if the first argument in your function is a
context.Contextby @27149chen in https://github.com/go-co-op/gocron/pull/819 & @JohnRoesler in https://github.com/go-co-op/gocron/pull/820
// NewTask provides the job's task function and parameters.
// If you set the first argument of your Task func to be a context.Context,
// gocron will pass in a context (either the default Job context, or one
// provided via WithContext) to the job and will cancel the context on shutdown.
// This allows you to listen for and handle cancellation within your job.Chores
- Bump golangci/golangci-lint-action from 6.1.1 to 6.2.0 by @dependabot in https://github.com/go-co-op/gocron/pull/817
Full Changelog: https://github.com/go-co-op/gocron/compare/v2.14.2...v2.15.0