scheduler
scheduler copied to clipboard
Add support for a .Delay(x) for recurrent jobs
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 atime.Duration
directly -
.Delay(10).Seconds()
: more complex and magic behaviour, it behaves likeEvery(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 :))
Coverage remained the same at 100.0% when pulling c8fecd8965b9bacc5aed23d0a8a71ed7fa4f7694 on keymon:add_delayed_start into ee74d2f83d82cd1d2e92ed3ec3dbaf162ca5ece5 on carlescere:master.
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.
Hello @carlescere, any feedback about this?