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

DelayFor support #32

Closed
vkaldi opened this issue Nov 16, 2013 · 6 comments
Closed

DelayFor support #32

vkaldi opened this issue Nov 16, 2013 · 6 comments

Comments

@vkaldi
Copy link
Contributor

vkaldi commented Nov 16, 2013

Hi!

Given that ToRunOnceIn() runs incorrectly (we have the same problem as with ToRunOnceAt(DateTime.Now.Add...)), I've created a proof of concept for delayed task startup.

https://github.com/vkaldi/FluentScheduler/tree/DelayFor-support

Check out the samples in ConsoleTester.Program.DelayForTest()

  1. There's an extension method DelayFor() that currently attaches only to Seconds()/Minutes() - will add support for the rest
  2. Each schedule now has a DelayRunFor property that defaults to Timespan.Zero
  3. On first execution (in AddSchedules), DelayRunFor is accounted in the calculation

Should I finish finish up the task properly?

@vkaldi
Copy link
Contributor Author

vkaldi commented Nov 16, 2013

@alexdancho
@mbrrg

@mbrrg
Copy link

mbrrg commented Nov 18, 2013

Please do! I'm very interested in the result. I just tried out your solution and it seems to work nicely, haven't looked at the code too much though.

@youcandanch
Copy link
Contributor

Absolutely. Thanks for catching that.

@vkaldi vkaldi mentioned this issue Nov 19, 2013
@jgeurts
Copy link
Contributor

jgeurts commented Nov 20, 2013

Thanks!

@jgeurts jgeurts closed this as completed Nov 20, 2013
@virtualvoid
Copy link

virtualvoid commented Jul 4, 2016

Hello,

I'm having issues with the DelayFor method.

registry.Schedule(new Job(workerName, workerInterval, workerIntervalAddition, workerRunDelay))
        .WithName(workerName)
        .ToRunNow()
        .AndEvery(workerInterval + workerIntervalAddition)
        .Seconds()
        .DelayFor(workerRunDelay).Seconds();

The DelayFor statement is ignored, why ? I'd like to execute the job now but with some delay, and then every X seconds again. How can I achieve that ?

Thanks

@tallesl
Copy link
Contributor

tallesl commented Jul 5, 2016

@virtualvoid

Looks like you found a bug. Do you mind opening an issue for it?

Edit: Nevermind, fixed on 4.1.2.

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

6 participants