Fix bug, which could cause recordings to get stuck
This commit is contained in:
parent
f3c0066d93
commit
dd6f41a574
|
@ -1,3 +1,7 @@
|
||||||
|
4.1.2
|
||||||
|
========================
|
||||||
|
* Fixed bug, which caused recordings to get stuck
|
||||||
|
|
||||||
4.1.1
|
4.1.1
|
||||||
========================
|
========================
|
||||||
* Added open in browser to context menu of thumb overviews
|
* Added open in browser to context menu of thumb overviews
|
||||||
|
|
|
@ -150,9 +150,9 @@ public class NextGenLocalRecorder implements Recorder {
|
||||||
if (!future.isDone()) {
|
if (!future.isDone()) {
|
||||||
downloadFutureQueue.put(future);
|
downloadFutureQueue.put(future);
|
||||||
} else {
|
} else {
|
||||||
downloadFutureRecordingMap.remove(future);
|
|
||||||
Recording rec = future.get();
|
Recording rec = future.get();
|
||||||
Download d = rec.getDownload();
|
Download d = rec.getDownload();
|
||||||
|
downloadFutureRecordingMap.remove(future);
|
||||||
if (d.isRunning()) {
|
if (d.isRunning()) {
|
||||||
long delay = Math.max(0, Duration.between(Instant.now(), d.getRescheduleTime()).toMillis());
|
long delay = Math.max(0, Duration.between(Instant.now(), d.getRescheduleTime()).toMillis());
|
||||||
ScheduledFuture<Recording> rescheduledFuture = downloadPool.schedule(rec, delay, TimeUnit.MILLISECONDS);
|
ScheduledFuture<Recording> rescheduledFuture = downloadPool.schedule(rec, delay, TimeUnit.MILLISECONDS);
|
||||||
|
@ -182,6 +182,7 @@ public class NextGenLocalRecorder implements Recorder {
|
||||||
private void fail(ScheduledFuture<Recording> future, Exception e) {
|
private void fail(ScheduledFuture<Recording> future, Exception e) {
|
||||||
if (downloadFutureRecordingMap.containsKey(future)) {
|
if (downloadFutureRecordingMap.containsKey(future)) {
|
||||||
Recording rec = downloadFutureRecordingMap.remove(future);
|
Recording rec = downloadFutureRecordingMap.remove(future);
|
||||||
|
deleteIfEmpty(rec);
|
||||||
removeRecordingProcess(rec);
|
removeRecordingProcess(rec);
|
||||||
rec.getDownload().finalizeDownload();
|
rec.getDownload().finalizeDownload();
|
||||||
LOG.error("Error while recording stream for model {}", rec.getModel(), e);
|
LOG.error("Error while recording stream for model {}", rec.getModel(), e);
|
||||||
|
|
Loading…
Reference in New Issue