From e29e1d12127cf9efecd1b21b2d5f718b6064edcb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:08:02 +0000 Subject: [PATCH] Bump github.com/robfig/cron/v3 from 3.0.0 to 3.0.1 Bumps [github.com/robfig/cron/v3](https://github.com/robfig/cron) from 3.0.0 to 3.0.1. - [Commits](https://github.com/robfig/cron/compare/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: github.com/robfig/cron/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +-- vendor/github.com/robfig/cron/v3/README.md | 4 +-- vendor/github.com/robfig/cron/v3/chain.go | 4 +-- vendor/github.com/robfig/cron/v3/cron.go | 7 ++++- vendor/github.com/robfig/cron/v3/doc.go | 31 +++++++++++++++++----- vendor/github.com/robfig/cron/v3/option.go | 2 +- vendor/modules.txt | 2 +- 8 files changed, 40 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 378935a78..ddedc2800 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/jonboulle/clockwork v0.4.0 github.com/mattn/go-sqlite3 v1.14.22 github.com/prometheus/client_golang v1.20.5 - github.com/robfig/cron/v3 v3.0.0 + github.com/robfig/cron/v3 v3.0.1 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.18.2 diff --git a/go.sum b/go.sum index 37415b9d9..0328164db 100644 --- a/go.sum +++ b/go.sum @@ -692,8 +692,8 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E= -github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= diff --git a/vendor/github.com/robfig/cron/v3/README.md b/vendor/github.com/robfig/cron/v3/README.md index 8db4f550f..984c537c0 100644 --- a/vendor/github.com/robfig/cron/v3/README.md +++ b/vendor/github.com/robfig/cron/v3/README.md @@ -72,7 +72,7 @@ It is backwards incompatible with both v1 and v2. These updates are required: // Seconds field, optional cron.New( cron.WithParser( - cron.SecondOptional | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)) + cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)) - The Cron type now accepts functional options on construction rather than the previous ad-hoc behavior modification mechanisms (setting a field, calling a setter). @@ -118,7 +118,7 @@ There are two cron spec formats in common usage: jobs in Java software [the Cron wikipedia page]: https://en.wikipedia.org/wiki/Cron -[the Quartz Scheduler]: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html +[the Quartz Scheduler]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/tutorial-lesson-06.html The original version of this package included an optional "seconds" field, which made it incompatible with both of these formats. Now, the "standard" format is diff --git a/vendor/github.com/robfig/cron/v3/chain.go b/vendor/github.com/robfig/cron/v3/chain.go index 118e5bbea..9565b418e 100644 --- a/vendor/github.com/robfig/cron/v3/chain.go +++ b/vendor/github.com/robfig/cron/v3/chain.go @@ -76,9 +76,9 @@ func DelayIfStillRunning(logger Logger) JobWrapper { // SkipIfStillRunning skips an invocation of the Job if a previous invocation is // still running. It logs skips to the given logger at Info level. func SkipIfStillRunning(logger Logger) JobWrapper { - var ch = make(chan struct{}, 1) - ch <- struct{}{} return func(j Job) Job { + var ch = make(chan struct{}, 1) + ch <- struct{}{} return FuncJob(func() { select { case v := <-ch: diff --git a/vendor/github.com/robfig/cron/v3/cron.go b/vendor/github.com/robfig/cron/v3/cron.go index f6e451db3..c7e917665 100644 --- a/vendor/github.com/robfig/cron/v3/cron.go +++ b/vendor/github.com/robfig/cron/v3/cron.go @@ -21,11 +21,16 @@ type Cron struct { logger Logger runningMu sync.Mutex location *time.Location - parser Parser + parser ScheduleParser nextID EntryID jobWaiter sync.WaitGroup } +// ScheduleParser is an interface for schedule spec parsers that return a Schedule +type ScheduleParser interface { + Parse(spec string) (Schedule, error) +} + // Job is an interface for submitted cron jobs. type Job interface { Run() diff --git a/vendor/github.com/robfig/cron/v3/doc.go b/vendor/github.com/robfig/cron/v3/doc.go index ac6b4b078..fa5d08b4d 100644 --- a/vendor/github.com/robfig/cron/v3/doc.go +++ b/vendor/github.com/robfig/cron/v3/doc.go @@ -1,6 +1,18 @@ /* Package cron implements a cron spec parser and job runner. +Installation + +To download the specific tagged release, run: + + go get github.com/robfig/cron/v3@v3.0.0 + +Import it in your program as: + + import "github.com/robfig/cron/v3" + +It requires Go 1.11 or later due to usage of Go Modules. + Usage Callers may register Funcs to be invoked on a given schedule. Cron will run @@ -9,7 +21,7 @@ them in their own goroutines. c := cron.New() c.AddFunc("30 * * * *", func() { fmt.Println("Every hour on the half hour") }) c.AddFunc("30 3-6,20-23 * * *", func() { fmt.Println(".. in the range 3-6am, 8-11pm") }) - c.AddFunc("CRON_TZ=Asia/Tokyo 30 04 * * * *", func() { fmt.Println("Runs at 04:30 Tokyo time every day") }) + c.AddFunc("CRON_TZ=Asia/Tokyo 30 04 * * *", func() { fmt.Println("Runs at 04:30 Tokyo time every day") }) c.AddFunc("@hourly", func() { fmt.Println("Every hour, starting an hour from now") }) c.AddFunc("@every 1h30m", func() { fmt.Println("Every hour thirty, starting an hour thirty from now") }) c.Start() @@ -47,11 +59,18 @@ Alternative Formats Alternative Cron expression formats support other fields like seconds. You can implement that by creating a custom Parser as follows. - cron.New( - cron.WithParser( - cron.SecondOptional | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)) + cron.New( + cron.WithParser( + cron.NewParser( + cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor))) + +Since adding Seconds is the most common modification to the standard cron spec, +cron provides a builtin function to do that, which is equivalent to the custom +parser you saw earlier, except that its seconds field is REQUIRED: + + cron.New(cron.WithSeconds()) -The most popular alternative Cron expression format is Quartz: +That emulates Quartz, the most popular alternative Cron schedule format: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html Special Characters @@ -150,7 +169,7 @@ The prefix "TZ=(TIME ZONE)" is also supported for legacy compatibility. Be aware that jobs scheduled during daylight-savings leap-ahead transitions will not be run! -Job Wrappers / Chain +Job Wrappers A Cron runner may be configured with a chain of job wrappers to add cross-cutting functionality to all submitted jobs. For example, they may be used diff --git a/vendor/github.com/robfig/cron/v3/option.go b/vendor/github.com/robfig/cron/v3/option.go index 07638201e..09e4278e7 100644 --- a/vendor/github.com/robfig/cron/v3/option.go +++ b/vendor/github.com/robfig/cron/v3/option.go @@ -23,7 +23,7 @@ func WithSeconds() Option { } // WithParser overrides the parser used for interpreting job schedules. -func WithParser(p Parser) Option { +func WithParser(p ScheduleParser) Option { return func(c *Cron) { c.parser = p } diff --git a/vendor/modules.txt b/vendor/modules.txt index 4e6534b06..fa0311468 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -898,7 +898,7 @@ github.com/prometheus/statsd_exporter/pkg/mapper/fsm # github.com/rivo/uniseg v0.4.4 ## explicit; go 1.18 github.com/rivo/uniseg -# github.com/robfig/cron/v3 v3.0.0 +# github.com/robfig/cron/v3 v3.0.1 ## explicit; go 1.12 github.com/robfig/cron/v3 # github.com/russross/blackfriday/v2 v2.1.0