diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/push/ApnPushNotificationScheduler.java b/service/src/main/java/org/whispersystems/textsecuregcm/push/ApnPushNotificationScheduler.java index 3091b9d91..7795f5d08 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/push/ApnPushNotificationScheduler.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/push/ApnPushNotificationScheduler.java @@ -91,7 +91,7 @@ public class ApnPushNotificationScheduler implements Managed { @Override public void run() { - while (running.get()) { + do { try { final long entriesProcessed = processNextSlot(); @@ -101,7 +101,7 @@ public class ApnPushNotificationScheduler implements Managed { } catch (Exception e) { logger.warn("Exception while operating", e); } - } + } while (running.get()); } private long processNextSlot() {