@@ -146,7 +146,7 @@ type defaultCron struct {
146
146
withSeconds bool
147
147
}
148
148
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 {
150
150
var withLocation string
151
151
if strings .HasPrefix (crontab , "TZ=" ) || strings .HasPrefix (crontab , "CRON_TZ=" ) {
152
152
withLocation = crontab
@@ -161,7 +161,7 @@ func (r *defaultCron) IsValid(crontab string, location *time.Location, now time.
161
161
err error
162
162
)
163
163
164
- if r .withSeconds {
164
+ if c .withSeconds {
165
165
p := cron .NewParser (cron .SecondOptional | cron .Minute | cron .Hour | cron .Dom | cron .Month | cron .Dow | cron .Descriptor )
166
166
cronSchedule , err = p .Parse (withLocation )
167
167
} else {
@@ -173,15 +173,15 @@ func (r *defaultCron) IsValid(crontab string, location *time.Location, now time.
173
173
if cronSchedule .Next (now ).IsZero () {
174
174
return ErrCronJobInvalid
175
175
}
176
- r .cronSchedule = cronSchedule
176
+ c .cronSchedule = cronSchedule
177
177
return nil
178
178
}
179
179
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 )
182
182
}
183
183
184
- // default cron job implimentation
184
+ // default cron job implementation
185
185
var _ JobDefinition = (* cronJobDefinition )(nil )
186
186
187
187
type cronJobDefinition struct {
@@ -195,7 +195,7 @@ func (c cronJobDefinition) setup(j *internalJob, location *time.Location, now ti
195
195
}
196
196
197
197
if err := c .cron .IsValid (c .crontab , location , now ); err != nil {
198
- return err
198
+ return err
199
199
}
200
200
201
201
j .jobSchedule = & cronJob {crontab : c .crontab , cronSchedule : c .cron }
0 commit comments