Call stop() instead of setting running=false

This commit is contained in:
0xb00bface 2021-01-23 13:13:25 +01:00
parent e9a71bd6f1
commit 3202d5d2cd
1 changed files with 6 additions and 6 deletions

View File

@ -117,21 +117,21 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
}
} catch (ParseException e) {
LOG.error("Couldn't parse HLS playlist for model {}\n{}", model, e.getInput(), e);
running = false;
stop();
} catch (PlaylistException e) {
LOG.error("Couldn't parse HLS playlist for model {}", model, e);
running = false;
stop();
} catch (PlaylistTimeoutException e) {
rescheduleTime = beforeLastPlaylistRequest; // try again as fast as possible
} catch (EOFException e) {
// end of playlist reached
LOG.debug("Reached end of playlist for model {}", model);
running = false;
stop();
} catch (HttpException e) {
handleHttpException(e);
} catch (Exception e) {
LOG.error("Couldn't download segment for model {}", model, e);
running = false;
stop();
}
return this;
}
@ -158,7 +158,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
} else {
if (consecutivePlaylistErrors >= 3) {
LOG.info("Playlist couldn't not be downloaded for model {} {} times. Stopping recording", model, (consecutivePlaylistErrors + 1), e);
running = false;
stop();
} else {
LOG.info("Playlist couldn't not be downloaded for model {} {} times: {}", model, (consecutivePlaylistErrors + 1), e.getLocalizedMessage());
}
@ -170,7 +170,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
try {
modelState = model.getOnlineState(false);
if (modelState != State.ONLINE) {
running = false;
stop();
}
} catch (ExecutionException e1) {
modelState = State.UNKNOWN;