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

[FEATURE] - I would like to know the next run time of a job that could not run because of the locker #530

Open
manuelarte opened this issue Jul 27, 2023 · 0 comments
Labels
enhancement New feature or request v2

Comments

@manuelarte
Copy link

Is your feature request related to a problem? Please describe

I would like to log the next run time of a job when the job is also "skipped" by the distributed locker.

Describe the solution you'd like

Maybe registering a new event listener for when error in Lock, something like this:

job.RegisterEventListeners(
		gocron.BeforeJobRuns(func(_ string) {
			logrus.Info("Job Started")
		}),
		gocron.AfterJobRuns(func(jobName string) {
			logrus.WithField("next-run", job.NextRun()).Info("Job Finished")
		}),
		gocron.AfterLockerError(func(jobName string) {
			logrus.WithField("next-run", job.NextRun()).Info("Job Skipped")
		}),
)

Describe alternatives you've considered

Additional context

@manuelarte manuelarte added the enhancement New feature or request label Jul 27, 2023
@JohnRoesler JohnRoesler added the v1 label Oct 28, 2023
@JohnRoesler JohnRoesler added v2 and removed v1 labels Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2
Projects
None yet
Development

No branches or pull requests

2 participants