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

features: add support in seconds #33

Open
igzhang opened this issue Dec 24, 2020 · 0 comments
Open

features: add support in seconds #33

igzhang opened this issue Dec 24, 2020 · 0 comments

Comments

@igzhang
Copy link

igzhang commented Dec 24, 2020

With the example

jobrunner.Schedule("* */5 * * * *", DoSomething{}) // every 5min do something

But log report err: expected exactly 5 fields, found 6.

The github.com/robfig/cron/v3 package already support it. So I support add this feature.

Code change suggest:

// runjob.go
func Schedule(spec string, job cron.Job) error {
	sched, err := cron.ParseStandard(spec)
        // change to 
       // sched, err := cron.Parse(spec)
	if err != nil {
		return err
	}
	MainCron.Schedule(sched, New(job))
	return nil
}

Thanks.

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

1 participant