diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountCleaner.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountCleaner.java index 99268c396..c8f38c3b4 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountCleaner.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountCleaner.java @@ -61,7 +61,9 @@ protected void onCrawlChunk(Optional fromUuid, List chunkAccounts .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); } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/PushFeedbackProcessor.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/PushFeedbackProcessor.java index 2fbff4c06..4e4173f08 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/PushFeedbackProcessor.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/PushFeedbackProcessor.java @@ -112,7 +112,9 @@ protected void onCrawlChunk(Optional fromUuid, List chunkAccounts .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); }