Merge pull request #227 from nlevitt/dont-checkpoint-unstarted

do not checkpoint if crawl job has not started
This commit is contained in:
Barbara Miller
2019-01-04 15:53:43 -08:00
committed by GitHub
@@ -240,6 +240,11 @@ public class CheckpointService implements Lifecycle, ApplicationContextAware, Ha
* Run a checkpoint of the crawler
*/
public synchronized String requestCrawlCheckpoint() throws IllegalStateException {
if (!controller.hasStarted()) {
LOGGER.info("crawl job has not started; ignoring");
return null;
}
if (isCheckpointing()) {
throw new IllegalStateException("Checkpoint already running.");
}