Add timeouts to crawl chunk `join()`s

This commit is contained in:
Chris Eager 2023-08-29 14:44:35 -05:00 committed by Chris Eager
parent a1e534a515
commit ecd6b0174a
2 changed files with 6 additions and 2 deletions

View File

@ -61,7 +61,9 @@ public class AccountCleaner extends AccountDatabaseCrawlerListener {
.toList();
try {
CompletableFuture.allOf(deletionFutures.toArray(new CompletableFuture[0])).join();
CompletableFuture.allOf(deletionFutures.toArray(new CompletableFuture[0]))
.orTimeout(10, TimeUnit.MINUTES)
.join();
} catch (final Exception e) {
log.debug("Failed to delete one or more accounts in chunk", e);
}

View File

@ -112,7 +112,9 @@ public class PushFeedbackProcessor extends AccountDatabaseCrawlerListener {
.toList();
try {
CompletableFuture.allOf(updateFutures.toArray(new CompletableFuture[0])).join();
CompletableFuture.allOf(updateFutures.toArray(new CompletableFuture[0]))
.orTimeout(10, TimeUnit.MINUTES)
.join();
} catch (final Exception e) {
log.debug("Failed to update one or more accounts in chunk", e);
}