mirror of
https://codeberg.org/monocles/monocles_chat.git
synced 2025-01-15 22:22:22 +01:00
don't retry if it is taking too long
(cherry picked from commit 8c264ea0441567ca9063dde4ee89c9e8719d69f1)
This commit is contained in:
parent
41d748e0f9
commit
180209c113
1 changed files with 2 additions and 0 deletions
|
@ -486,11 +486,13 @@ public class Resolver {
|
|||
|
||||
private static <D extends Data> ListenableFuture<ResolverResult<D>> resolveAsFuture(
|
||||
final DnsName dnsName, final Class<D> type) {
|
||||
final var start = System.currentTimeMillis();
|
||||
return Futures.submit(
|
||||
() -> {
|
||||
final Question question = new Question(dnsName, Record.TYPE.getType(type));
|
||||
if (!DNSSECLESS_TLDS.contains(dnsName.getLabels()[0].toString())) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if (System.currentTimeMillis() - start > 5000) break;
|
||||
try {
|
||||
ResolverResult<D> result = DnssecResolverApi.INSTANCE.resolve(question);
|
||||
if (result.wasSuccessful() && !result.isAuthenticData()) {
|
||||
|
|
Loading…
Reference in a new issue