Commit Graph

6 Commits

Author SHA1 Message Date
Thomas Orozco
e7ecf3f459 Add overlapping flag
This allows overlapping instances of a given job. To make this easier to
test, this also refactors `StartJob` into a helper `startFunc` to make
this functionality easier to unit test.

Co-authored-by: Pavel Popov <pavelpopov@outlook.com>
2019-02-08 15:28:32 +01:00
Thomas Orozco
398e49a968 Use a context to exit after being signalled
Using a (cancellable) context is a little more idiomatic than
re-implementing one using a channel, and it's a little more efficient
(since we share one context across all job goroutines, as opposed to
requiring one cancel channel per goroutine).
2018-04-23 14:38:06 +02:00
Thomas Orozco
4a929a35a6 startReaderDrain: handle arbitrarily long lines
`bufio.Scanner` can only handle lines up to 64kB. Beyond that, it'll
crash with `bufio.Scanner: token too long`.

We shouldn't crash when this happens. Instead, let's just continue
reading, and warn the user. This is what this does.
2017-09-04 11:27:59 +02:00
Thomas Orozco
0e133a9560 Fix: Supercronic skips a beat
We're launching everything one iteration later than scheduled. That's
not great!

I'd like to rethink the test approach a little bit here. Testing through
the logger is not ideal (we should probably just pump all the logs
through channels back to the main goroutine).
2017-07-11 20:33:13 +02:00
Thomas Orozco
4023ab896e StartJob: basic test 2017-07-11 12:56:20 +02:00
Thomas Orozco
1fb787cbcb Add cron RunJob tests 2017-07-11 12:56:19 +02:00