Be a bit more relaxed with deleting recordings

This commit is contained in:
0xboobface 2019-08-16 19:34:07 +02:00
parent 372fce2899
commit 8935dd8185
1 changed files with 4 additions and 7 deletions

View File

@ -119,12 +119,9 @@ public class NextGenLocalRecorder implements Recorder {
Model model = recording.getModel(); Model model = recording.getModel();
tryRestartRecording(model); tryRestartRecording(model);
} else { } else {
if(recording.getStatus() != State.DELETED) {
delete(recording);
}
setRecordingStatus(recording, State.FAILED); setRecordingStatus(recording, State.FAILED);
} }
} catch (InterruptedException | ExecutionException | InvalidKeyException | NoSuchAlgorithmException | IllegalStateException | IOException e) { } catch (InterruptedException | ExecutionException | IllegalStateException e) {
LOG.error("Error while completing recording", e); LOG.error("Error while completing recording", e);
} }
} }
@ -257,12 +254,12 @@ public class NextGenLocalRecorder implements Recorder {
setRecordingStatus(rec, State.RECORDING); setRecordingStatus(rec, State.RECORDING);
recordingManager.saveRecording(rec); recordingManager.saveRecording(rec);
download.start(); download.start();
boolean deleted = deleteIfEmpty(rec);
setRecordingStatus(rec, deleted ? State.DELETED : State.WAITING);
recordingManager.saveRecording(rec);
} catch (IOException e) { } catch (IOException e) {
LOG.error("Download for {} failed. Download state: {}", model.getName(), rec.getStatus(), e); LOG.error("Download for {} failed. Download state: {}", model.getName(), rec.getStatus(), e);
} }
boolean deleted = deleteIfEmpty(rec);
setRecordingStatus(rec, deleted ? State.DELETED : State.WAITING);
recordingManager.saveRecording(rec);
return rec; return rec;
}); });
} finally { } finally {