- Move the "shutdownOrCancelCode" input in the "inputDataFile" provided by the user, for convenience and to be able to make this "auth-code" mandatory. Previously, it was optional and the app could not be made to stop in a normal-manner, if this code was not provided.
@ -6,8 +6,11 @@ The Worker responds by compressing and sending the requested files in each batch
<br>
To install and run the application:
- Run ```git clone``` and then ```cd UrlsWorker```.
- [Optional] Create the file ```inputData.txt``` , which contains just one line with the ___workerId___, the __maxAssignmentsLimitPerBatch__, the __maxAssignmentsBatchesToHandleBeforeRestart__ and the ___controller's base api-url___, all seperated by a _comma_ ```,``` . For example: ```worker_1,1000,0,http://IP:PORT/api/```.
- Execute the ```installAndRun.sh``` script. In case the above file (_inputData.txt_) does not exist, it will request the required data from the user, and then it will create the _inputData.txt_ file.<br>
- [Optional] Create the file ```inputData.txt``` , which contains just one line with the ___workerId___, the ___maxAssignmentsLimitPerBatch___, the ___maxAssignmentsBatchesToHandleBeforeRestart___, the ___controller's base api-url___ and the ___shutdownOrCancelCode___, all seperated by a _comma_ "```,```" .<br>
For example: ```worker_1,1000,0,http://IP:PORT/api/,stopOrCancelCode```.<br>
The ___shutdownOrCancelCode___ is kind of an "auth-code", when receiving "__shutdown__" and "__cancel-shutdown__" requests.
- Execute the ```installAndRun.sh``` script.<br>
In case the above file (_inputData.txt_) does not exist, the script will request the required data from the user, and then it will create the _inputData.txt_ file.<br>
StringerrorMsg="No \"workerId\" or/and \"maxAssignmentsLimitPerBatch\" or/and \"maxAssignmentsBatchesToHandleBeforeRestart\" or/and \"controllerBaseUrl\" could be retrieved from the file: "+inputDataFilePath;
StringerrorMsg="No \"workerId\" or/and \"maxAssignmentsLimitPerBatch\" or/and \"maxAssignmentsBatchesToHandleBeforeRestart\" or/and \"controllerBaseUrl\" or/and \"shutdownOrCancelCode\" could be retrieved from the file: "+inputDataFilePath;
logger.error(errorMsg);
System.err.println(errorMsg);
System.exit(63);
}
logger.info("workerId: "+workerId+", maxAssignmentsLimitPerBatch: "+maxAssignmentsLimitPerBatch+", maxAssignmentsBatchesToHandleBeforeRestart: "+maxAssignmentsBatchesToHandleBeforeShutdown+", controllerBaseUrl: "+controllerBaseUrl);// It's safe and helpful to show them in the logs.
logger.info(initMsg+" Any previous \"shutdownWorker\"-request is canceled. The \"maxAssignmentsBatchesToHandleBeforeShutdown\" will still be honored (if it's set).");