-
Notifications
You must be signed in to change notification settings - Fork 345
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
possibility to perform a schedule from HH:MM till HH:MM ? #68
Comments
I think you can do gocron.Every(1).Day().At("18:30").Do(task_stop) |
LGTM, prefect! |
How to run it Every 5 Minutes? It only run once at 8:00? |
Expanding on the example - this works: package main
import (
"log"
"github.com/jasonlvhit/gocron"
)
func task() {
log.Println("I am runnning task.")
}
func task_start() {
log.Println("Starting the task.")
gocron.Every(5).Minutes().From(gocron.NextTick()).Do(task)
}
func task_stop() {
log.Println("Stopping the task.")
gocron.Remove(task)
}
func main() {
gocron.Every(1).Day().At("08:00").Do(task_start)
gocron.Every(1).Day().At("18:30").Do(task_stop)
<-gocron.Start()
} |
@JohnRoesler Perfect! thanks. |
Hi,
Do you know whether it would be possible to include a from HH:MM till HH:MM feature ?
Let's say I want to schedule a task every 5MIN from Monday to Friday, from 8:00 till 18:30.
maybe with a
gocron.Clear()
<- gocron.Start()
That would be a good feature if it is currently not possible.
Any idea ?
Thanks,
The text was updated successfully, but these errors were encountered: