mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: fix close session with recording in starting status
parent
3a61ce0f86
commit
0d00ad8fee
|
@ -280,12 +280,10 @@ public class RecordingManager {
|
|||
this.cdr.recordRecordingStatusChanged(recording, null, recording.getCreatedAt(),
|
||||
Status.started);
|
||||
|
||||
if (!((properties.outputMode().equals(OutputMode.COMPOSED)
|
||||
|| properties.outputMode().equals(OutputMode.COMPOSED_QUICK_START))
|
||||
&& properties.hasVideo())) {
|
||||
if (!(OutputMode.COMPOSED.equals(properties.outputMode()) && properties.hasVideo())) {
|
||||
// Directly send recording started notification for all cases except for
|
||||
// COMPOSED/COMPOSED_QUICK_START recordings with video (will be sent on first
|
||||
// RECORDER subscriber)
|
||||
// COMPOSED recordings with video (will be sent on first RECORDER subscriber)
|
||||
// Both INDIVIDUAL and COMPOSED_QUICK_START should notify immediately
|
||||
this.sessionHandler.sendRecordingStartedNotification(session, recording);
|
||||
}
|
||||
if (session.getActivePublishers() == 0) {
|
||||
|
@ -320,7 +318,19 @@ public class RecordingManager {
|
|||
recording = this.sessionsRecordings.get(session.getSessionId());
|
||||
}
|
||||
|
||||
recording = ((RecordingService) singleStreamRecordingService).sealRecordingMetadataFileAsStopped(recording);
|
||||
if (recording == null) {
|
||||
recording = this.sessionsRecordingsStarting.get(session.getSessionId());
|
||||
if (recording == null) {
|
||||
log.error("Cannot stop recording. Session {} is not being recorded", recordingId,
|
||||
session.getSessionId());
|
||||
return null;
|
||||
} else {
|
||||
// Recording is still starting
|
||||
log.warn("Recording {} is still in \"starting\" status", recording.getId());
|
||||
}
|
||||
}
|
||||
|
||||
((RecordingService) singleStreamRecordingService).sealRecordingMetadataFileAsStopped(recording);
|
||||
|
||||
final long timestamp = System.currentTimeMillis();
|
||||
this.cdr.recordRecordingStatusChanged(recording, reason, timestamp, Status.stopped);
|
||||
|
@ -412,8 +422,15 @@ public class RecordingManager {
|
|||
public void stopOneIndividualStreamRecording(KurentoSession session, String streamId, long kmsDisconnectionTime) {
|
||||
Recording recording = this.sessionsRecordings.get(session.getSessionId());
|
||||
if (recording == null) {
|
||||
log.error("Cannot stop recording of existing stream {}. Session {} is not being recorded", streamId,
|
||||
session.getSessionId());
|
||||
recording = this.sessionsRecordingsStarting.get(session.getSessionId());
|
||||
if (recording == null) {
|
||||
log.error("Cannot stop recording of existing stream {}. Session {} is not being recorded", streamId,
|
||||
session.getSessionId());
|
||||
return;
|
||||
} else {
|
||||
// Recording is still starting
|
||||
log.warn("Recording {} is still in \"starting\" status", recording.getId());
|
||||
}
|
||||
}
|
||||
if (OutputMode.INDIVIDUAL.equals(recording.getOutputMode())) {
|
||||
// Stop specific RecorderEndpoint for this stream
|
||||
|
|
Loading…
Reference in New Issue