openvidu-server exception when recording enabled and Docker not installed

pull/30/head
pabloFuente 2018-01-29 16:42:50 +01:00
parent 75afcf16e1
commit b9fd3f3c22
4 changed files with 16 additions and 4 deletions

View File

@ -19,6 +19,8 @@ import java.io.IOException;
import java.net.URL;
import java.util.List;
import javax.ws.rs.ProcessingException;
import org.kurento.jsonrpc.JsonUtils;
import org.kurento.jsonrpc.internal.server.config.JsonRpcConfiguration;
import org.kurento.jsonrpc.server.JsonRpcConfigurer;
@ -199,7 +201,15 @@ public class OpenViduServer implements JsonRpcConfigurer {
RecordingService recordingService = context.getBean(RecordingService.class);
System.out.println("Recording module required: Downloading openvidu/openvidu-recording Docker image (800 MB aprox)");
if (recordingService.recordingImageExistsLocally()) {
boolean imageExists = false;
try {
imageExists = recordingService.recordingImageExistsLocally();
} catch (ProcessingException exception) {
log.error("Exception connecting to Docker daemon: you need Docker installed in this machine to enable OpenVidu recorder service");
throw new RuntimeException("Exception connecting to Docker daemon: you need Docker installed in this machine to enable OpenVidu recorder service");
}
if (imageExists) {
System.out.println("Docker image already exists locally");
} else {
Thread t = new Thread(() -> {

View File

@ -6,6 +6,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.ProcessingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -104,6 +106,8 @@ public class RecordingService {
imageExists = true;
} catch (NotFoundException nfe) {
imageExists = false;
} catch (ProcessingException e) {
throw e;
}
return imageExists;
}

View File

@ -149,7 +149,7 @@
<dependency>
<groupId>io.openvidu</groupId>
<artifactId>openvidu-java-client</artifactId>
<version>1.1.0</version>
<version>1.7.0</version>
</dependency>
</dependencies>

View File

@ -19,7 +19,6 @@ package io.openvidu.test.e2e;
import static java.lang.invoke.MethodHandles.lookup;
import static org.slf4j.LoggerFactory.getLogger;
import static org.hamcrest.CoreMatchers.is;
import static org.openqa.selenium.OutputType.BASE64;
import org.slf4j.Logger;
@ -31,7 +30,6 @@ import org.junit.jupiter.api.*;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.runner.RunWith;
import org.junit.platform.runner.JUnitPlatform;
import org.json.simple.JSONObject;
import org.junit.Assert;
import org.openqa.selenium.By;