Skip to content

Commit 186cc66

Browse files
authored
[LP-11063] Fixing batching of start call and race condition (#378)
* Fixing batching of start call * Reverting background check
1 parent 7d6d58e commit 186cc66

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

AndroidSDKCore/src/main/java/com/leanplum/internal/RequestOld.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,19 +486,20 @@ private void sendNow() {
486486
return;
487487
}
488488

489-
this.sendEventually();
489+
// We need to save request first.
490+
sendEventually();
490491

491492
Leanplum.countAggregator().incrementCount("send_now");
492493

493-
Util.executeAsyncTask(true, new AsyncTask<Void, Void, Void>() {
494+
// Try to send all saved requests.
495+
OperationQueue.sharedInstance().addOperation(new Runnable() {
494496
@Override
495-
protected Void doInBackground(Void... params) {
497+
public void run() {
496498
try {
497499
sendRequests();
498500
} catch (Throwable t) {
499501
Util.handleException(t);
500502
}
501-
return null;
502503
}
503504
});
504505
}

0 commit comments

Comments
 (0)