Fix and document the -r option which runs a named job on startup #406
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed there was a non-functional and undocumented -r command-line option which automatically runs a given job when Heritrix starts. I suspect this was never finished due to the bug that was fixed in commit 643f16d where launch() returns before the job has been launched.
This option seems like it would be very useful so you could run a job from cron or another scheduling program without having to use the REST API to start it. Therefore I've enabled it and extended it so it also unpauses, waits for the crawl to finish and then exits.
Merge note: This PR shares commit "Remove arbitrary 1.5 second sleep() when launching jobs" with #405. I've included it in both so that the two PRs can be merged independently. Assuming that git will do the right thing and notice they're same commit anyway... 🤞