Add timeouts to crawl chunk join()s

This commit is contained in:
Chris Eager authored and Chris Eager committed 2023-08-31 15:03:19 -05:00
1 parent a1e534a515
commit ecd6b0174a
2 files changed
+6 -2

No files matched your search

@@ -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);
}
@@ -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);
}