mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: use same Media Node id strategy for decrementing active recordings
parent
eedf393f6a
commit
0f9f0b4565
|
@ -67,7 +67,8 @@ public class FixedOneKmsManager extends KmsManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void decrementActiveRecordings(String mediaNodeId, String recordingId) {
|
public void decrementActiveRecordings(RecordingProperties recordingProperties, String recordingId,
|
||||||
|
Session session) {
|
||||||
try {
|
try {
|
||||||
this.getKmss().iterator().next().decrementActiveRecordings(recordingId);
|
this.getKmss().iterator().next().decrementActiveRecordings(recordingId);
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
|
|
|
@ -357,7 +357,8 @@ public abstract class KmsManager {
|
||||||
public abstract void incrementActiveRecordings(RecordingProperties recordingProperties, String recordingId,
|
public abstract void incrementActiveRecordings(RecordingProperties recordingProperties, String recordingId,
|
||||||
Session session);
|
Session session);
|
||||||
|
|
||||||
public abstract void decrementActiveRecordings(String mediaNodeId, String recordingId);
|
public abstract void decrementActiveRecordings(RecordingProperties recordingProperties, String recordingId,
|
||||||
|
Session session);
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected abstract void postConstructInitKurentoClients();
|
protected abstract void postConstructInitKurentoClients();
|
||||||
|
|
|
@ -286,8 +286,7 @@ public class ComposedRecordingService extends RecordingService {
|
||||||
cleanRecordingMaps(recordingAux);
|
cleanRecordingMaps(recordingAux);
|
||||||
|
|
||||||
// Decrement active recordings
|
// Decrement active recordings
|
||||||
kmsManager.decrementActiveRecordings(recordingAux.getRecordingProperties().mediaNode(),
|
kmsManager.decrementActiveRecordings(recordingAux.getRecordingProperties(), recordingId, session);
|
||||||
recordingId);
|
|
||||||
|
|
||||||
if (i == timeout) {
|
if (i == timeout) {
|
||||||
log.error("Container did not launched in {} seconds", timeout / 2);
|
log.error("Container did not launched in {} seconds", timeout / 2);
|
||||||
|
@ -363,8 +362,8 @@ public class ComposedRecordingService extends RecordingService {
|
||||||
// Decrement active recordings once it is downloaded. This method will also drop
|
// Decrement active recordings once it is downloaded. This method will also drop
|
||||||
// the Media Node if no more sessions or recordings and status is
|
// the Media Node if no more sessions or recordings and status is
|
||||||
// waiting-idle-to-terminate
|
// waiting-idle-to-terminate
|
||||||
kmsManager.decrementActiveRecordings(finalRecordingArray[0].getRecordingProperties().mediaNode(),
|
kmsManager.decrementActiveRecordings(finalRecordingArray[0].getRecordingProperties(),
|
||||||
finalRecordingArray[0].getId());
|
finalRecordingArray[0].getId(), session);
|
||||||
|
|
||||||
// Upload if necessary
|
// Upload if necessary
|
||||||
this.uploadRecording(finalRecordingArray[0], reason);
|
this.uploadRecording(finalRecordingArray[0], reason);
|
||||||
|
@ -593,7 +592,7 @@ public class ComposedRecordingService extends RecordingService {
|
||||||
// Decrement active recordings once it is downloaded. This method will also drop
|
// Decrement active recordings once it is downloaded. This method will also drop
|
||||||
// the Media Node if no more sessions or recordings and status is
|
// the Media Node if no more sessions or recordings and status is
|
||||||
// waiting-idle-to-terminate
|
// waiting-idle-to-terminate
|
||||||
kmsManager.decrementActiveRecordings(recording.getRecordingProperties().mediaNode(), recording.getId());
|
kmsManager.decrementActiveRecordings(recording.getRecordingProperties(), recording.getId(), session);
|
||||||
|
|
||||||
// Upload if necessary
|
// Upload if necessary
|
||||||
this.uploadRecording(recording, reason);
|
this.uploadRecording(recording, reason);
|
||||||
|
|
|
@ -334,7 +334,7 @@ public class RecordingManager {
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// DECREMENT ACTIVE RECORDINGS OF MEDIA NODE AND TRY REMOVE MEDIA NODE HERE
|
// DECREMENT ACTIVE RECORDINGS OF MEDIA NODE AND TRY REMOVE MEDIA NODE HERE
|
||||||
kmsManager.decrementActiveRecordings(properties.mediaNode(), recordingId);
|
kmsManager.decrementActiveRecordings(properties, recordingId, session);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,8 @@ public class SingleStreamRecordingService extends RecordingService {
|
||||||
// Decrement active recordings once it is downloaded. This method will also drop
|
// Decrement active recordings once it is downloaded. This method will also drop
|
||||||
// the Media Node if no more sessions or recordings and status is
|
// the Media Node if no more sessions or recordings and status is
|
||||||
// waiting-idle-to-terminate
|
// waiting-idle-to-terminate
|
||||||
kmsManager.decrementActiveRecordings(session.getMediaNodeId(), finalRecordingArray[0].getId());
|
kmsManager.decrementActiveRecordings(finalRecordingArray[0].getRecordingProperties(),
|
||||||
|
finalRecordingArray[0].getId(), session);
|
||||||
|
|
||||||
// Upload if necessary
|
// Upload if necessary
|
||||||
this.uploadRecording(finalRecordingArray[0], reason);
|
this.uploadRecording(finalRecordingArray[0], reason);
|
||||||
|
|
Loading…
Reference in New Issue