Update TransferServiceImpl.java and TransferUtils.java

This commit is contained in:
Andrea Cavalli 2020-10-20 22:25:49 +02:00
parent 52019d505a
commit ed70a65608
2 changed files with 5 additions and 1 deletions

View File

@ -411,6 +411,10 @@ public class TransferServiceImpl implements TransferService {
}
)
.last()
.onErrorMap(error -> {
error.printStackTrace();
return new Exception("Error while obtaining source group members: " + error.getLocalizedMessage(), error);
})
.subscribeOn(Schedulers.boundedElastic())
.map(members -> Tuple2.of(clients, members));
})

View File

@ -210,7 +210,7 @@ public class TransferUtils {
if (supergroupFullInfo.upgradedFromBasicGroupId == 0 && supergroupFullInfo.upgradedFromMaxMessageId == 0
&& supergroupFullInfo.memberCount > 500) {
TdApi.Chat info = client
.<Chat>send(new TdApi.GetChat(supergroupId))
.<Chat>send(new TdApi.GetChat(chatEntityIdToChatId(supergroupId, TChatType.SUPERGROUP)))
.flatMap(MonoUtils::orElseThrow)
.timeout(Duration.ofMinutes(2))
.blockOptional()