Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

At() seems to be not working #36

Closed
davisdevs opened this issue Apr 1, 2017 · 6 comments
Closed

At() seems to be not working #36

davisdevs opened this issue Apr 1, 2017 · 6 comments

Comments

@davisdevs
Copy link

gocron.Every(1).Day().At("9:00").Do(task)

The task gets run every day at time of scheduling execution instead of every day at specified timing

@shukla2112
Copy link

@davis12529 Is this resolved? I don't see any PR, How did you solve?

@davisdevs
Copy link
Author

@shukla2112 are you facing this issue as well? Unfortunately I am currently tight in deadlines and could not take a closer look at it. I had to switch to another library.

@mkozjak
Copy link

mkozjak commented Jul 30, 2017

@davis12529 Which one? Did you find it good for you?

@davisdevs
Copy link
Author

@mkozjak https://github.com/carlescere/scheduler, works well for me.

The only downside is that you cannot pass arguments to the job within the schedule function. One of the workaround is to create an anonymous function with no parameters and call the intended function pass the parameters directly

e.g.

task := func() { foo("param1", "param2") }

@mkozjak
Copy link

mkozjak commented Jul 31, 2017

@davis12529: Yeah, been looking into that one, too. That was the downside for me to, too. I decided to just use the cron lib.

@kaiiak
Copy link
Collaborator

kaiiak commented Sep 19, 2017

@davis12529 @mkozjak
I think you should write this way.

gocron.Every(1).Day().At("09:00").Do(task)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants