Code cleanup.
This commit is contained in:
parent
b63ad87d00
commit
0d2f0b8b01
|
@ -56,9 +56,6 @@ public class AssignmentsHandler {
|
|||
|
||||
public static AssignmentsRequest requestAssignments()
|
||||
{
|
||||
// Go request the assignments, the worker is busy. This may take more time than the scheduled time to request new assignments.
|
||||
isAvailableForWork = false;
|
||||
|
||||
String requestUrl = UrlsWorkerApplication.controllerBaseUrl + (askForTest ? "test/" : "") + "urls?workerId=" + UrlsWorkerApplication.workerId + "&workerAssignmentsLimit=" + UrlsWorkerApplication.maxAssignmentsLimitPerBatch;
|
||||
logger.info("Going to request assignments from the controller-server: " + requestUrl);
|
||||
|
||||
|
@ -77,6 +74,9 @@ public class AssignmentsHandler {
|
|||
|
||||
public static void handleAssignments()
|
||||
{
|
||||
// Go request the assignments, the worker is busy. This may take more time than the scheduled time to request new assignments.
|
||||
isAvailableForWork = false;
|
||||
|
||||
AssignmentsRequest assignmentsRequest = requestAssignments();
|
||||
if ( assignmentsRequest == null ) {
|
||||
isAvailableForWork = true; // Make sure it is "true" both in case of a "RestClientException" and in case of a "null" object.
|
||||
|
|
Loading…
Reference in New Issue