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