From fbee357d6ba9eb540101cf09393f7eebafdfd49d Mon Sep 17 00:00:00 2001 From: Justin Fiedler Date: Wed, 17 Apr 2024 10:10:34 -0700 Subject: [PATCH] fix: always run middleware flush on updateServer (#400) --- src/main/java/com/amplitude/api/AmplitudeClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/amplitude/api/AmplitudeClient.java b/src/main/java/com/amplitude/api/AmplitudeClient.java index 537443c7..1b027eed 100644 --- a/src/main/java/com/amplitude/api/AmplitudeClient.java +++ b/src/main/java/com/amplitude/api/AmplitudeClient.java @@ -2122,7 +2122,6 @@ public void run() { } identifyInterceptor.transferInterceptedIdentify(); updateServer(); - middlewareRunner.flush(); } }); } @@ -2159,6 +2158,9 @@ protected void updateServer(boolean limit) { return; } + // Flush middleware + middlewareRunner.flush(); + // if returning out of this block, always be sure to set uploadingCurrently to false!! if (!uploadingCurrently.getAndSet(true)) { long totalEventCount = dbHelper.getTotalEventCount();