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] ability to immediately start an @every job #406

Open
wsw70 opened this issue Aug 11, 2021 · 0 comments
Open

[feature] ability to immediately start an @every job #406

wsw70 opened this issue Aug 11, 2021 · 0 comments

Comments

@wsw70
Copy link

@wsw70 wsw70 commented Aug 11, 2021

Would it be possible to add an option to start jobs scheduled as @every immediately (and not after the interval)?

The docs mention that

For example, "@every 1h30m10s" would indicate a schedule that activates after 1 hour, 30 minutes, 10 seconds, and then every interval after that.

I believe that there it would be interesting to have the immediate start - for instance, I need to do

googleCalendar()
forecast()
temperature()
c := cron.New()
c.AddFunc("@every 1min", googleCalendar)
c.AddFunc("@every 15min", forecast)
c.AddFunc("@every 12min", temperature)
c.Start()

instead of, say

c := cron.New({intervalRunAtStartup: true})
c.AddFunc("@every 1min", googleCalendar)
c.AddFunc("@every 15min", forecast)
c.AddFunc("@every 12min", temperature)
c.Start()

(see also #396)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant