When I tried to update a job(copy from the example), it returns an error: gocron: wrong list of params.
To Reproduce
func update() error{
task := func(in string, job gocron.Job) {
fmt.Printf("this job's last run: %s this job's next run: %s\n", job.LastRun(), job.NextRun())
fmt.Printf("in argument is %s\n", in)
ticker := time.NewTicker(100 * time.Millisecond)
defer ticker.Stop()
for {
select {
case <-job.Context().Done():
fmt.Printf("function has been canceled, performing cleanup and exiting gracefully\n")
return
case <-ticker.C:
fmt.Printf("performing a hard job that takes a long time that I want to kill whenever I want\n")
}
}
}
var err error
s := gocron.NewScheduler(time.UTC)
s.SingletonModeAll()
s.WaitForScheduleAll()
j, err := s.Every(1).Hour().Tag("myJob").DoWithJobDetails(task, "foo")
if err != nil {
log.Fatalln("error scheduling job", err)
return err
}
s.StartAsync()
time.Sleep(time.Second)
_, err = s.Job(j).Every(3).Hour().Update()
if err != nil {
log.Fatalln("error Update job", err)
return err
}
log.Printf("update over")
return nil
}
Describe the bug
When I tried to update a job(copy from the example), it returns an error: gocron: wrong list of params.
To Reproduce
Version
v1.34.2
Expected behavior
nothing happend
Additional context