Ignore timeouts in placeholders
This commit is contained in:
+1
-3
@@ -40,9 +40,7 @@ public class EstimatedTime extends Placeholder {
|
||||
cache.put(p.getUniqueId(), response.getEither());
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
plugin.getLogger().log(Level.WARNING, "Timed out while trying to get placeholder data from proxy: ", e);
|
||||
}
|
||||
} catch (TimeoutException ignored) {}
|
||||
});
|
||||
|
||||
return cache.getOrDefault(p.getUniqueId(), "...");
|
||||
|
||||
@@ -39,9 +39,7 @@ public class InQueue extends Placeholder {
|
||||
cache.put(p.getUniqueId(), response + "");
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
plugin.getLogger().log(Level.WARNING, "Timed out while trying to get placeholder data from proxy: ", e);
|
||||
}
|
||||
} catch (TimeoutException ignored) {}
|
||||
});
|
||||
|
||||
return cache.getOrDefault(p.getUniqueId(), "...");
|
||||
|
||||
+1
-3
@@ -40,9 +40,7 @@ public class Position extends Placeholder {
|
||||
cache.put(p.getUniqueId(), response.getEither());
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
plugin.getLogger().log(Level.WARNING, "Timed out while trying to get placeholder data from proxy: ", e);
|
||||
}
|
||||
} catch (TimeoutException ignored) {}
|
||||
});
|
||||
|
||||
return cache.getOrDefault(p.getUniqueId(), "...");
|
||||
|
||||
+1
-3
@@ -40,9 +40,7 @@ public class PositionOf extends Placeholder {
|
||||
cache.put(p.getUniqueId(), response.getEither());
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
plugin.getLogger().log(Level.WARNING, "Timed out while trying to get placeholder data from proxy: ", e);
|
||||
}
|
||||
} catch (TimeoutException ignored) {}
|
||||
});
|
||||
|
||||
return cache.getOrDefault(p.getUniqueId(), "...");
|
||||
|
||||
@@ -40,9 +40,7 @@ public class Queued extends Placeholder {
|
||||
cache.put(p.getUniqueId(), response.getEither());
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
plugin.getLogger().log(Level.WARNING, "Timed out while trying to get placeholder data from proxy: ", e);
|
||||
}
|
||||
} catch (TimeoutException ignored) {}
|
||||
});
|
||||
|
||||
return cache.getOrDefault(p.getUniqueId(), "...");
|
||||
|
||||
+1
-3
@@ -43,15 +43,13 @@ public class QueuedFor extends Placeholder {
|
||||
cache.put(queue, response + "");
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
plugin.getLogger().log(Level.WARNING, "Timed out while trying to get placeholder data from proxy: ", e);
|
||||
} catch (ExecutionException e) {
|
||||
if(e.getCause() instanceof IllegalArgumentException) {
|
||||
cache.put(queue, invalidMessage);
|
||||
} else {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
} catch (TimeoutException ignored) {}
|
||||
});
|
||||
|
||||
return cached;
|
||||
|
||||
@@ -43,15 +43,13 @@ public class Status extends Placeholder {
|
||||
cache.put(queue, response);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
plugin.getLogger().log(Level.WARNING, "Timed out while trying to get placeholder data from proxy: ", e);
|
||||
} catch (ExecutionException e) {
|
||||
if(e.getCause() instanceof IllegalArgumentException) {
|
||||
cache.put(queue, invalidMessage);
|
||||
} else {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
} catch (TimeoutException ignored) {}
|
||||
});
|
||||
|
||||
return cached;
|
||||
|
||||
+1
-3
@@ -46,9 +46,7 @@ public class StatusPlayer extends Placeholder {
|
||||
cache.put(key, response);
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (TimeoutException e) {
|
||||
plugin.getLogger().log(Level.WARNING, "Timed out while trying to get placeholder data from proxy: ", e);
|
||||
}
|
||||
} catch (TimeoutException ignored) {}
|
||||
});
|
||||
|
||||
return cache.getOrDefault(key, "...");
|
||||
|
||||
Reference in New Issue
Block a user