Bugfix
This commit is contained in:
parent
cebf75d87d
commit
606cd23deb
@ -87,9 +87,9 @@ public class AsyncTdDirectImpl implements AsyncTdDirect {
|
||||
// Send close if the stream is disposed before tdlib is closed
|
||||
emitter.onDispose(() -> {
|
||||
closedFromTd.asMono().take(Duration.ofMillis(10)).switchIfEmpty(Mono.fromRunnable(() -> client.send(new Close(),
|
||||
result -> logger.trace("Close result: {}", result),
|
||||
ex -> logger.trace("Error when disposing td client", ex)
|
||||
))).subscribe();
|
||||
result -> logger.warn("Close result: {}", result),
|
||||
ex -> logger.error("Error when disposing td client", ex)
|
||||
))).subscribeOn(tdScheduler).subscribe();
|
||||
});
|
||||
}).subscribeOn(tdScheduler);
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class AsyncTdEasy {
|
||||
}
|
||||
|
||||
private Flux<TdApi.Update> getIncomingUpdates(boolean includePreAuthUpdates) {
|
||||
return Flux.from(incomingUpdatesCo).subscribeOn(scheduler).doOnComplete(() -> requestedDefinitiveExit.onNext(true));
|
||||
return Flux.from(incomingUpdatesCo).doFinally(s -> requestedDefinitiveExit.onNext(true)).subscribeOn(scheduler);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -294,6 +294,10 @@ public class AsyncTdEasy {
|
||||
.then(Mono.from(requestedDefinitiveExit).single())
|
||||
.filter(closeRequested -> !closeRequested)
|
||||
.doOnSuccess(v -> requestedDefinitiveExit.onNext(true))
|
||||
.then(td.execute(new TdApi.Close(), false))
|
||||
.doOnNext(ok -> {
|
||||
logger.debug("Received Ok after TdApi.Close");
|
||||
})
|
||||
.then(authState
|
||||
.filter(authorizationState -> authorizationState.getConstructor() == AuthorizationStateClosed.CONSTRUCTOR)
|
||||
.take(1)
|
||||
|
Loading…
Reference in New Issue
Block a user