Skip to content

Commit

Permalink
openvidu-server: close sessions before closing KurentoClients on PreD…
Browse files Browse the repository at this point in the history
…estroy
  • Loading branch information
pabloFuente committed May 20, 2021
1 parent 0117e7e commit e2b6963
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.annotation.PreDestroy;

import org.apache.commons.lang3.RandomStringUtils;
import org.kurento.client.GenericMediaElement;
import org.kurento.client.IceCandidate;
Expand Down Expand Up @@ -1444,4 +1446,11 @@ protected Kms selectMediaNode(Session session) throws OpenViduException {
return lessLoadedKms;
}

@PreDestroy
@Override
public void close() {
super.close();
this.kmsManager.closeAllKurentoClients();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.util.stream.Collectors;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.apache.commons.lang3.RandomStringUtils;
import org.kurento.jsonrpc.client.JsonRpcWSConnectionListener;
Expand Down Expand Up @@ -343,8 +342,7 @@ public abstract void decrementActiveRecordings(RecordingProperties recordingProp
@PostConstruct
protected abstract void postConstructInitKurentoClients();

@PreDestroy
public void close() {
public void closeAllKurentoClients() {
log.info("Closing all KurentoClients");
this.kmss.values().forEach(kms -> {
if (kms.getKurentoClientReconnectTimer() != null) {
Expand Down

0 comments on commit e2b6963

Please sign in to comment.