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

Question: Multiple At #11

Open
limoli opened this issue Mar 19, 2019 · 5 comments
Open

Question: Multiple At #11

limoli opened this issue Mar 19, 2019 · 5 comments

Comments

@limoli
Copy link

limoli commented Mar 19, 2019

I am new into this library and I would know if there is the possibility to implement multiple scheduled hours using At method.

Example

sched.Schedule().Every(2).Days().At("9:30").At("11:30").Do(something)

Or

sched.Schedule().Every(2).Days().At([]string{"12:32", "11:30"}).Do(something)
@sbrki
Copy link
Owner

sbrki commented Apr 8, 2019

Looks cool, shouldn't be too hard to implement, you can try it and open a PR if you want :)

@unishubh
Copy link

Is this issue still open?

@pizzalord22
Copy link

@unishubh it is tagged as open, are you working on a pr or waiting for whiteshtef to add it in?

@sbrki
Copy link
Owner

sbrki commented Nov 5, 2019

@pizzalord22 it is still open. Is use of multiple At statements really that useful?
I could implement it if you find it easier to use.

I personally use

sched.Schedule().Every().Day().At("xxx").Do(foo)
sched.Schedule().Every().Day().At("yyy").Do(foo)

because it seems more readable than

sched.Schedule().Every().Day().At("xxx").At("yyy").Do(foo)

If you really want it as a one-liner, it shouldn't be too hard to implement,
but it will ad some complexity to the scheduleNextRun() method which is already horrible as it is.

@pizzalord22
Copy link

@whiteShtef i would go for readability, since keeping things readable and as simple as possible makes it easier to implement new things.

that being said it might be nice to have multiple function ran in the same row in a certrain order.

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

3 participants