jasonlvhit / gocron

A Golang Job Scheduling Package.
BSD 2-Clause "Simplified" License
3.46k stars 345 forks source link

Scheduling same function to run at same time fails #20

Closed gracedo closed 8 years ago

gracedo commented 8 years ago

Scheduling the same function to run at the same time hasn't been working for me. It works fine if I schedule two different functions at the same time, but it fails with the same function (looks like it's only running the latest declared statement instead of both?).

e.g.

gocron.Every(5).Seconds().Do(someFunc, 1)
gocron.Every(5).Seconds().Do(someFunc, 2)
<-gocron.Start()

^ I see only one instance of someFunc running with param 2 -- the latest declared is run.

Any ideas what may be going wrong here? I've also tried running them in different goroutines, but it still fails.

gracedo commented 8 years ago

Just saw that @kilhage fixes this in https://github.com/jasonlvhit/gocron/pull/15 -- closing the issue