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();