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.Pattern;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.kurento.client.GenericMediaElement;
|
||||
import org.kurento.client.IceCandidate;
|
||||
|
|
@ -1444,4 +1446,11 @@ public class KurentoSessionManager extends SessionManager {
|
|||
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 javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.kurento.jsonrpc.client.JsonRpcWSConnectionListener;
|
||||
|
|
@ -343,8 +342,7 @@ public abstract class KmsManager {
|
|||
@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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue