From 13c2c1645004ec5d58bb3de0fdd65b069a2f444b Mon Sep 17 00:00:00 2001 From: Justin Fiedler Date: Wed, 17 Apr 2024 16:58:15 +0000 Subject: [PATCH] fix: always run middleware flush on updateServer --- 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();