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

[BUG] - panic: runtime error: integer divide by zero #486

Closed
artking28 opened this issue May 12, 2023 · 3 comments · Fixed by #505
Closed

[BUG] - panic: runtime error: integer divide by zero #486

artking28 opened this issue May 12, 2023 · 3 comments · Fixed by #505
Labels
bug Something isn't working

Comments

@artking28
Copy link

Describe the bug

My runtime is exiting by it, I dont know why, its only When I use ur library

My code

func LaunchCronTasks(port string) error {
	s := gocron.NewScheduler(time.UTC)

	
	if _, err := s.Every(30).Seconds().StartAt(time.Now().Add(10 * time.Second)).Do(func() []error {
		var errs []error
		errs = append(errs, myFunction())
		return errs
	}); err != nil {
		return err
	}

	if s.Len() > 0 {
		s.StartAsync()
		println("\033[32m" + "[PORT" + port + "] Cron launched with success       --> " + utils.IntoString(time.Now()) + "\033[0m")
	}
	return nil
}

Version

v1.18.0

Captura de ecrã 2023-05-11, às 21 39 06

@artking28 artking28 added the bug Something isn't working label May 12, 2023
@JohnRoesler
Copy link
Contributor

@artking28 have you tried the latest version?

@artking28
Copy link
Author

artking28 commented May 12, 2023

Thank u, v1.27 works fine

@BranislavLazic
Copy link

@JohnRoesler 1.28.0 version - still the same problem. Basically, this is the cause: StartAt(time.Now().Add(10 * time.Second))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants