Skip to content

Commit 72f10e4

Browse files
committed
Don't need RxJava to call transitionToLocalOnly
1 parent 6f945fc commit 72f10e4

File tree

1 file changed

+5
-6
lines changed
  • aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine

1 file changed

+5
-6
lines changed

aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/Orchestrator.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,11 @@ private void onApiSyncFailure(Throwable exception) {
404404
return;
405405
}
406406
LOG.warn("API sync failed - transitioning to LOCAL_ONLY.", exception);
407-
Disposable subscription = Completable.fromAction(this::transitionToLocalOnly)
408-
.subscribe(
409-
() -> { /* no-op */ },
410-
error -> LOG.warn("Transition to LOCAL_ONLY failed.", error)
411-
);
412-
disposables.add(subscription);
407+
try {
408+
transitionToLocalOnly();
409+
} catch (Exception error) {
410+
LOG.warn("Transition to LOCAL_ONLY failed.", error);
411+
}
413412
}
414413

415414
private void disposeNetworkChanges() {

0 commit comments

Comments
 (0)