We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have the below code
package main import ( "fmt" "time" "github.com/jasonlvhit/gocron" ) func main() { funmap := make(map[string]func()) for i := 1; i < 6; i++ { funmap[fmt.Sprintf("func%d", i)] = getJob(i) } gs := gocron.NewScheduler() gs.Every(5).Seconds().Do(funmap["func1"]) gs.Every(5).Seconds().Do(funmap["func2"]) gs.Every(5).Seconds().Do(funmap["func3"]) gs.Every(5).Seconds().Do(funmap["func4"]) gs.Every(5).Seconds().Do(funmap["func5"]) fmt.Println(gs.Len()) gs.Start() time.Sleep(time.Second * 10) fmt.Println("*************************") gs.Remove(funmap["func3"]) gs.Remove(funmap["func5"]) time.Sleep(time.Second * 10) gs.Clear() } func getJob(i int) func() { return func() { fmt.Println("This is func:", i) } }
I want to remove jobs with their names.but It deletes first two entries. How to solve this?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have the below code
I want to remove jobs with their names.but It deletes first two entries.
How to solve this?
The text was updated successfully, but these errors were encountered: