openvidu-server: decouple recording stopped ws notification and CD/webhook message

pull/375/head
pabloFuente 2019-06-25 11:02:09 +02:00
parent bd54e77f08
commit cc934b5d71
3 changed files with 6 additions and 3 deletions

View File

@ -439,8 +439,6 @@ public class SessionEventsHandler {
public void sendRecordingStoppedNotification(Session session, Recording recording, EndReason reason) {
CDR.recordRecordingStopped(session.getSessionId(), recording, reason);
// Be sure to clean this map (this should return null)
this.recordingsStarted.remove(session.getSessionId());

View File

@ -328,6 +328,9 @@ public class ComposedRecordingService extends RecordingService {
throw new OpenViduException(Code.RECORDING_REPORT_ERROR_CODE,
"There was an error generating the metadata report file for the recording");
}
this.cdr.recordRecordingStopped(recording.getSessionId(), recording, reason);
if (session != null && reason != null) {
this.recordingManager.sessionHandler.sendRecordingStoppedNotification(session, recording, reason);
}
@ -380,8 +383,9 @@ public class ComposedRecordingService extends RecordingService {
long finalSize = videoFile.length();
double finalDuration = (double) compositeWrapper.getDuration() / 1000;
this.updateFilePermissions(filesPath);
this.sealRecordingMetadataFileAsStopped(recording, finalSize, finalDuration,
finalRecordingArray[0] = this.sealRecordingMetadataFileAsStopped(recording, finalSize, finalDuration,
filesPath + RecordingManager.RECORDING_ENTITY_FILE + recording.getId());
cdr.recordRecordingStopped(finalRecordingArray[0].getSessionId(), finalRecordingArray[0], reason);
});
} catch (IOException e) {
log.error("Error while downloading recording {}: {}", recording.getName(), e.getMessage());

View File

@ -171,6 +171,7 @@ public class SingleStreamRecordingService extends RecordingService {
}
}
finalRecordingArray[0] = this.sealMetadataFiles(recording);
cdr.recordRecordingStopped(finalRecordingArray[0].getSessionId(), finalRecordingArray[0], reason);
});
} catch (IOException e) {
log.error("Error while downloading recording {}", recording.getName());