- Fix a bug, which caused the old full-text files to not be deleted.
- Reduce the "InitialDelay" for the "checkIfShouldShutdown" scheduler.
This commit is contained in:
parent
0ca02f3587
commit
1bf27a5a4e
|
@ -65,7 +65,7 @@ public class ScheduledTasks {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Scheduled(initialDelay = 1_800_000, fixedDelay = 1_800_000)
|
@Scheduled(initialDelay = 900_000, fixedDelay = 1_800_000) // InitialDelay = 15 mins, FixedDelay = 30 mins.
|
||||||
public void checkIfShouldShutdown()
|
public void checkIfShouldShutdown()
|
||||||
{
|
{
|
||||||
if ( !GeneralController.shouldShutdownWorker && !AssignmentsHandler.shouldNotRequestMore )
|
if ( !GeneralController.shouldShutdownWorker && !AssignmentsHandler.shouldNotRequestMore )
|
||||||
|
@ -99,7 +99,7 @@ public class ScheduledTasks {
|
||||||
|
|
||||||
private static final int hoursToWaitBeforeDeletion = 36;
|
private static final int hoursToWaitBeforeDeletion = 36;
|
||||||
|
|
||||||
@Scheduled(initialDelay = 21_600_000, fixedDelay = 21_600_000)
|
@Scheduled(initialDelay = 21_600_000, fixedDelay = 21_600_000) // InitialDelay & FixedDelay = 36 hours.
|
||||||
public void checkAndDeleteOldFiles() {
|
public void checkAndDeleteOldFiles() {
|
||||||
// For any reason the Worker-report connection with the Controller may fail, but the Controller will continue requesting the full-text batches.
|
// For any reason the Worker-report connection with the Controller may fail, but the Controller will continue requesting the full-text batches.
|
||||||
|
|
||||||
|
@ -119,8 +119,8 @@ public class ScheduledTasks {
|
||||||
int usableDirsNum = 0;
|
int usableDirsNum = 0;
|
||||||
try {
|
try {
|
||||||
File fullTextsBaseDir = new File(fileStorageService.assignmentsBaseLocation);
|
File fullTextsBaseDir = new File(fileStorageService.assignmentsBaseLocation);
|
||||||
if ( fullTextsBaseDir.isDirectory() ) {
|
if ( !fullTextsBaseDir.isDirectory() ) {
|
||||||
logger.warn("The full-texts directory still exists, wait for the Controller to take all the files or some time to past before they are deleted. Then the Worker will shut down.");
|
logger.error("The \"fullTextsBaseDir\" (" + fileStorageService.assignmentsBaseLocation + ") does not exist!"); // This base dir should always exist during execution!
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue