Skip to content

Commit

Permalink
fix: always run middleware flush on updateServer
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-fiedler committed Apr 17, 2024
1 parent 79aab5f commit 13c2c16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/amplitude/api/AmplitudeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,6 @@ public void run() {
}
identifyInterceptor.transferInterceptedIdentify();
updateServer();
middlewareRunner.flush();
}
});
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 13c2c16

Please sign in to comment.