From 07ff969422f7266657c082e637a9f0339386f489 Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Thu, 11 Jun 2020 22:02:59 -0500 Subject: [PATCH] Rc12 bonanza - fix hourly refresh bug, bump version number --- build.gradle | 2 +- src/main/java/mdnet/base/MangaDexClient.java | 10 +++++----- src/main/kotlin/mdnet/base/Application.kt | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 3afc0c9..00ab45e 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group = "com.mangadex" -version = "1.0.0-rc10" +version = "1.0.0-rc12" mainClassName = "mdnet.base.MangaDexClient" repositories { diff --git a/src/main/java/mdnet/base/MangaDexClient.java b/src/main/java/mdnet/base/MangaDexClient.java index 5283446..b02ba49 100644 --- a/src/main/java/mdnet/base/MangaDexClient.java +++ b/src/main/java/mdnet/base/MangaDexClient.java @@ -84,6 +84,11 @@ public class MangaDexClient { counter.set(num + 1); } + // if the server is offline then don't try and refresh certs + if (engine == null) { + return; + } + if (clientSettings.getMaxBandwidthMibPerHour() != 0 && clientSettings.getMaxBandwidthMibPerHour() * 1024 * 1024 /* MiB to bytes */ < statistics.get().getBytesSent().get()) { if (LOGGER.isInfoEnabled()) { @@ -95,11 +100,6 @@ public class MangaDexClient { } } - // if the server is offline then don't try and refresh certs - if (engine == null) { - return; - } - ServerSettings n = serverHandler.pingControl(serverSettings); if (LOGGER.isInfoEnabled()) { diff --git a/src/main/kotlin/mdnet/base/Application.kt b/src/main/kotlin/mdnet/base/Application.kt index 9afd854..fbb8957 100644 --- a/src/main/kotlin/mdnet/base/Application.kt +++ b/src/main/kotlin/mdnet/base/Application.kt @@ -39,7 +39,6 @@ import javax.crypto.CipherOutputStream import javax.crypto.spec.SecretKeySpec private val LOGGER = LoggerFactory.getLogger("Application") -private val THREADS_TO_ALLOCATE = 65535 // Have it at the maximum open sockets a user can have in most modern OSes. No reason to limit this, just limit it at the Netty side. fun getServer(cache: DiskLruCache, serverSettings: ServerSettings, clientSettings: ClientSettings, statistics: AtomicReference): Http4kServer { val executor = Executors.newCachedThreadPool() @@ -55,8 +54,9 @@ fun getServer(cache: DiskLruCache, serverSettings: ServerSettings, clientSetting .setSocketTimeout(3000) .setConnectionRequestTimeout(3000) .build()) - .setMaxConnTotal(THREADS_TO_ALLOCATE) - .setMaxConnPerRoute(THREADS_TO_ALLOCATE) + .setMaxConnTotal(65535) + .setMaxConnPerRoute(65535) + // Have it at the maximum open sockets a user can have in most modern OSes. No reason to limit this, just limit it at the Netty side. .build()) val app = { dataSaver: Boolean ->