[Updated] Dockerfiles so everything runs using docker compose up, added the benchmark and speed tests
This commit is contained in:
@@ -48,4 +48,21 @@ public class ApiService {
|
||||
logger.log(System.Logger.Level.ERROR, "Critical failure", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect a chuck of 50 items
|
||||
* Store them in the DataService
|
||||
*/
|
||||
public void collectBulk() {
|
||||
String url = apiUrl + "?amount=50";
|
||||
try {
|
||||
ResponseEntity<String> response = restTemplate.getForEntity(url, String.class);
|
||||
String json = response.getBody();
|
||||
ApiResponse apiResponse = cleanerService.extractApiResponse(json);
|
||||
responseHandler.handleResponse(apiResponse);
|
||||
|
||||
} catch (RestClientException | IOException e) {
|
||||
logger.log(System.Logger.Level.ERROR, "Critical failure", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ResponseHandlingService {
|
||||
|
||||
switch (response.getResponseCode()) {
|
||||
case 0:
|
||||
// Nothing
|
||||
// Success
|
||||
updateSessionInCache(session, response);
|
||||
break;
|
||||
case 1:
|
||||
@@ -58,7 +58,7 @@ public class ResponseHandlingService {
|
||||
/**
|
||||
* If the request was made by the scheduler during queue-downtime, there is no session
|
||||
*/
|
||||
public void switchInternal(ApiResponse response) {
|
||||
public void handleResponse(ApiResponse response) {
|
||||
switch (response.getResponseCode()) {
|
||||
case 0:
|
||||
// TODO: Store in DB
|
||||
|
||||
Reference in New Issue
Block a user