Skip to content

Commit 69b4347

Browse files
committed
clean up
1 parent 36cd85f commit 69b4347

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

job.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ type defaultCron struct {
146146
withSeconds bool
147147
}
148148

149-
func (r *defaultCron) IsValid(crontab string, location *time.Location, now time.Time) error {
149+
func (c *defaultCron) IsValid(crontab string, location *time.Location, now time.Time) error {
150150
var withLocation string
151151
if strings.HasPrefix(crontab, "TZ=") || strings.HasPrefix(crontab, "CRON_TZ=") {
152152
withLocation = crontab
@@ -161,7 +161,7 @@ func (r *defaultCron) IsValid(crontab string, location *time.Location, now time.
161161
err error
162162
)
163163

164-
if r.withSeconds {
164+
if c.withSeconds {
165165
p := cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
166166
cronSchedule, err = p.Parse(withLocation)
167167
} else {
@@ -173,15 +173,15 @@ func (r *defaultCron) IsValid(crontab string, location *time.Location, now time.
173173
if cronSchedule.Next(now).IsZero() {
174174
return ErrCronJobInvalid
175175
}
176-
r.cronSchedule = cronSchedule
176+
c.cronSchedule = cronSchedule
177177
return nil
178178
}
179179

180-
func (r *defaultCron) Next(lastRun time.Time) time.Time {
181-
return r.cronSchedule.Next(lastRun)
180+
func (c *defaultCron) Next(lastRun time.Time) time.Time {
181+
return c.cronSchedule.Next(lastRun)
182182
}
183183

184-
// default cron job implimentation
184+
// default cron job implementation
185185
var _ JobDefinition = (*cronJobDefinition)(nil)
186186

187187
type cronJobDefinition struct {
@@ -195,7 +195,7 @@ func (c cronJobDefinition) setup(j *internalJob, location *time.Location, now ti
195195
}
196196

197197
if err := c.cron.IsValid(c.crontab, location, now); err != nil {
198-
return err
198+
return err
199199
}
200200

201201
j.jobSchedule = &cronJob{crontab: c.crontab, cronSchedule: c.cron}

0 commit comments

Comments
 (0)