- Update a method-call, to reflect the latest changes in the "PublicationsRetriever"-software.

- Add TODOs.
This commit is contained in:
Lampros Smyrnaios 2023-01-17 18:25:49 +02:00
parent c283cb4365
commit 7dd5719bff
2 changed files with 5 additions and 4 deletions

View File

@ -19,6 +19,7 @@ public class ScheduledTasks {
public void handleNewAssignments() {
if ( AssignmentsHandler.hadConnectionErrorOnRequest ) {
if ( GeneralController.shouldShutdownWorker ) // Make sure the worker shuts-down, in case the user sends the relevant request, while the worker is stuck in a data-request error-loop.
// TODO - Should this worker inform the Controller that will shutdown?
UrlsWorkerApplication.gentleAppShutdown();
try {
Thread.sleep(900_000); // Sleep for 15 mins to stall the scheduler from retrying right away, thus giving time to the Controller to recover.

View File

@ -156,10 +156,9 @@ public class AssignmentsHandler {
}
if ( idUrlPairsHandled >= ((timesClearingDomainAndPathTrackingData +1) * idUrlsToHandleBeforeClearingDomainAndPathTrackingData) ) {
GenericUtils.clearDomainAndPathTrackingData();
GenericUtils.clearTrackingData(); // This includes the "blocking data", we may say "if this condition is true, do not bother checking the just-blocking condition".
timesClearingDomainAndPathTrackingData ++;
timesClearingDomainAndPathBlockingData ++; // Increment this also, as we avoid the following check in this case, but the counter has to be increased nevertheless.
// This includes the "blocking data", we may say "if this condition is true, do not bother checking the just-blocking condition"
} else if ( idUrlPairsHandled >= ((timesClearingDomainAndPathBlockingData +1) * idUrlsToHandleBeforeClearingDomainAndPathBlockingData) ) {
GenericUtils.clearDomainAndPathBlockingData();
timesClearingDomainAndPathBlockingData ++;
@ -171,8 +170,9 @@ public class AssignmentsHandler {
logger.info("The worker will now shutdown, as " + (GeneralController.shouldShutdownWorker
? "it received a \"shutdownWorker\" request!"
: "the maximum assignments-batches (" + UrlsWorkerApplication.maxAssignmentsBatchesToHandleBeforeShutdown + ") to be handled was reached!"));
UrlsWorkerApplication.gentleAppShutdown();
// The "gentleAppShutdown()" will exit the app, so the "isAvailableForWork" will not be set below.
// TODO - Should this worker inform the Controller that will shutdown?
UrlsWorkerApplication.gentleAppShutdown(); // This will exit the app.
}
// Note: Cannot call this method, here, retrospectively, as if it runs 100s of times, the memory-stack may break..