executorbase bugfixes
This commit is contained in:
parent
0460f1c793
commit
45edd76c8b
|
@ -10,6 +10,7 @@ import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import ch.unisg.common.valueobject.ExecutorURI;
|
import ch.unisg.common.valueobject.ExecutorURI;
|
||||||
|
@ -49,12 +50,13 @@ public class GetAssignmentAdapter implements GetAssignmentPort {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info("Sending getAssignment Request");
|
logger.info("ExecutorBase | Sending getAssignment request");
|
||||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||||
logger.log(Level.INFO, "getAssignment request result:\n {0}", response.body());
|
if (response.statusCode() != HttpStatus.CREATED.value()) {
|
||||||
if (response.body().equals("")) {
|
logger.info("ExecutorBase | No task assigned");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
logger.info("ExecutorBase | Task assigned");
|
||||||
JSONObject responseBody = new JSONObject(response.body());
|
JSONObject responseBody = new JSONObject(response.body());
|
||||||
|
|
||||||
String inputData = responseBody.getString("inputData");
|
String inputData = responseBody.getString("inputData");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user