Revert "fix(api): AddCron fix after library update (#3014)" (#3016)

This reverts commit c432ead45f.
pull/3019/head
Anthony Lapenna 5 years ago committed by GitHub
parent c432ead45f
commit 92a615d7b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,8 +19,7 @@ func NewJobScheduler() *JobScheduler {
// ScheduleJob schedules the execution of a job via a runner
func (scheduler *JobScheduler) ScheduleJob(runner portainer.JobRunner) error {
_, err := scheduler.cron.AddJob(runner.GetSchedule().CronExpression, runner)
return err
return scheduler.cron.AddJob(runner.GetSchedule().CronExpression, runner)
}
// UpdateSystemJobSchedule updates the first occurence of the specified
@ -36,7 +35,7 @@ func (scheduler *JobScheduler) UpdateSystemJobSchedule(jobType portainer.JobType
for _, entry := range cronEntries {
if entry.Job.(portainer.JobRunner).GetSchedule().JobType == jobType {
_, err := newCron.AddJob(newCronExpression, entry.Job)
err := newCron.AddJob(newCronExpression, entry.Job)
if err != nil {
return err
}
@ -70,7 +69,7 @@ func (scheduler *JobScheduler) UpdateJobSchedule(runner portainer.JobRunner) err
jobRunner = entry.Job
}
_, err := newCron.AddJob(runner.GetSchedule().CronExpression, jobRunner)
err := newCron.AddJob(runner.GetSchedule().CronExpression, jobRunner)
if err != nil {
return err
}

Loading…
Cancel
Save