mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: close sessions before closing KurentoClients on PreDestroy
parent
0117e7ece4
commit
e2b6963a6b
|
@ -31,6 +31,8 @@ import java.util.concurrent.TimeUnit;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.annotation.PreDestroy;
|
||||||
|
|
||||||
import org.apache.commons.lang3.RandomStringUtils;
|
import org.apache.commons.lang3.RandomStringUtils;
|
||||||
import org.kurento.client.GenericMediaElement;
|
import org.kurento.client.GenericMediaElement;
|
||||||
import org.kurento.client.IceCandidate;
|
import org.kurento.client.IceCandidate;
|
||||||
|
@ -1444,4 +1446,11 @@ public class KurentoSessionManager extends SessionManager {
|
||||||
return lessLoadedKms;
|
return lessLoadedKms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreDestroy
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
super.close();
|
||||||
|
this.kmsManager.closeAllKurentoClients();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.RandomStringUtils;
|
import org.apache.commons.lang3.RandomStringUtils;
|
||||||
import org.kurento.jsonrpc.client.JsonRpcWSConnectionListener;
|
import org.kurento.jsonrpc.client.JsonRpcWSConnectionListener;
|
||||||
|
@ -343,8 +342,7 @@ public abstract class KmsManager {
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected abstract void postConstructInitKurentoClients();
|
protected abstract void postConstructInitKurentoClients();
|
||||||
|
|
||||||
@PreDestroy
|
public void closeAllKurentoClients() {
|
||||||
public void close() {
|
|
||||||
log.info("Closing all KurentoClients");
|
log.info("Closing all KurentoClients");
|
||||||
this.kmss.values().forEach(kms -> {
|
this.kmss.values().forEach(kms -> {
|
||||||
if (kms.getKurentoClientReconnectTimer() != null) {
|
if (kms.getKurentoClientReconnectTimer() != null) {
|
||||||
|
|
Loading…
Reference in New Issue