From 099932ae68c27d1ffd584a99599ffec529226021 Mon Sep 17 00:00:00 2001 From: Jonathan Klabunde Tomer Date: Fri, 2 Jun 2023 10:44:04 -0700 Subject: [PATCH] ApnPushNotifcationScheduler: always run worker thread at least once --- .../textsecuregcm/push/ApnPushNotificationScheduler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() {