scheduler icon indicating copy to clipboard operation
scheduler copied to clipboard

Add support for a .Delay(x) for recurrent jobs

Open keymon opened this issue 6 years ago • 3 comments

In ocassions we want to add some delay to a recurrent job that is different to the recurrent period itself.

I add a .Delay() modifier that changes the time for the initial delay. This in incompatible to NotImmediatelly().

I added here two possible implementation in two different commits:

  • .Delay(10 * time.Second): we pass a time.Duration directly
  • .Delay(10).Seconds(): more complex and magic behaviour, it behaves like Every(x), but nicer to read

Let me know which one you like the most and I can rebase this PR (or just merge it if you like it :))

keymon avatar Jun 13 '18 17:06 keymon

Coverage Status

Coverage remained the same at 100.0% when pulling c8fecd8965b9bacc5aed23d0a8a71ed7fa4f7694 on keymon:add_delayed_start into ee74d2f83d82cd1d2e92ed3ec3dbaf162ca5ece5 on carlescere:master.

coveralls avatar Jun 13 '18 17:06 coveralls

Not sure why travis fails for go1.2, it seems it does not install the cover tool. I tried to reproduce it myself with go1.2.2, but I couldn't.

keymon avatar Jun 13 '18 20:06 keymon

Hello @carlescere, any feedback about this?

keymon avatar Aug 29 '18 17:08 keymon