Fix zombie recordings
received data check was being skipped due to exceptions
This commit is contained in:
parent
466d705131
commit
5cadac31ce
|
@ -136,11 +136,6 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
|
|||
recordingEvents.remove(0);
|
||||
}
|
||||
|
||||
if (Duration.between(lastSegmentDownload, Instant.now()).getSeconds() > MAX_SECONDS_WITHOUT_TRANSFER) {
|
||||
LOG.info("No video data received for {} seconds. Stopping recording for model {}", MAX_SECONDS_WITHOUT_TRANSFER, model);
|
||||
stop();
|
||||
return this;
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
LOG.error("Couldn't parse HLS playlist for model {}\n{}", model, e.getInput(), e);
|
||||
model.delay();
|
||||
|
@ -172,6 +167,12 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
|
|||
LOG.debug("Consecutive playlist errors: {}", consecutivePlaylistErrors);
|
||||
}
|
||||
}
|
||||
|
||||
if (Duration.between(lastSegmentDownload, Instant.now()).getSeconds() > MAX_SECONDS_WITHOUT_TRANSFER) {
|
||||
LOG.info("No video data received for {} seconds. Stopping recording for model {}", MAX_SECONDS_WITHOUT_TRANSFER, model);
|
||||
stop();
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -303,8 +304,13 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
|
|||
throw new HttpException(response.code(), response.message());
|
||||
}
|
||||
} catch (SocketTimeoutException e) {
|
||||
LOG.debug("Playlist request timed out ({}ms) for model {}:{} {} time{}", config.getSettings().playlistRequestTimeout, model.getSite().getName(), model,
|
||||
++consecutivePlaylistTimeouts, (consecutivePlaylistTimeouts > 1) ? 's' : "");
|
||||
LOG.debug("Playlist request timed out ({}ms) for model {}:{} {} time{} (took {}ms)",
|
||||
config.getSettings().playlistRequestTimeout,
|
||||
model.getSite().getName(),
|
||||
model,
|
||||
++consecutivePlaylistTimeouts,
|
||||
(consecutivePlaylistTimeouts > 1) ? 's' : "",
|
||||
(Duration.between(start, Instant.now()).toMillis()));
|
||||
// times out, return an empty playlist, so that the process can continue without wasting much more time
|
||||
recordingEvents.add(RecordingEvent.of("Playlist request timed out " + consecutivePlaylistTimeouts));
|
||||
throw new PlaylistTimeoutException(e);
|
||||
|
|
Loading…
Reference in New Issue