only send tps that is under 20

This commit is contained in:
EmmaKnijn 2024-08-01 14:14:28 +02:00
parent 468a829a8a
commit 801bcbffbc

View file

@ -69,13 +69,15 @@ public class Ctserver implements ModInitializer {
//LOGGER.info(String.valueOf(timeBetween));
//LOGGER.info(String.valueOf(mspt));
//LOGGER.info(String.valueOf(tps));
CompletableFuture.runAsync(() -> {
try {
sendPostRequest("http://us-ky-medium-0004.knijn.one:58926/tps", String.valueOf(tps));
} catch (Exception e) {
LOGGER.error("Failed to send POST request", e);
}
});
if (tps < 20) {
CompletableFuture.runAsync(() -> {
try {
sendPostRequest("http://us-ky-medium-0004.knijn.one:58926/tps", String.valueOf(tps));
} catch (Exception e) {
LOGGER.error("Failed to send POST request", e);
}
});
}
//LOGGER.info("Sent HTTP request");
tickCounter = 0;
zeroTicks = Instant.now().toEpochMilli();