mirror of https://github.com/go-co-op/gocron.git
issue-738: make withSeconds optional in cron-expression (#739)
This commit is contained in:
parent
399ac2807b
commit
9e83a13c14
2
job.go
2
job.go
|
|
@ -124,7 +124,7 @@ func (c cronJobDefinition) setup(j *internalJob, location *time.Location) error
|
|||
)
|
||||
|
||||
if c.withSeconds {
|
||||
p := cron.NewParser(cron.Second | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
|
||||
p := cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
|
||||
cronSchedule, err = p.Parse(withLocation)
|
||||
} else {
|
||||
cronSchedule, err = cron.ParseStandard(withLocation)
|
||||
|
|
|
|||
Loading…
Reference in New Issue