From 69151d058fb41176218eea435899d8bf404761fe Mon Sep 17 00:00:00 2001 From: Amos Ng Date: Fri, 12 Jun 2020 17:17:01 +0800 Subject: [PATCH] Re-added missing default `threads_per_cpu` setting --- CHANGELOG.md | 1 + src/main/java/mdnet/base/ClientSettings.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58345ca..c7cc0f6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed ### Fixed +- [2020-06-12] Re-added missing default `threads_per_cpu` setting by [@lflare]. ### Security - [2020-06-12] Update ClientSettings.java changed showing client secret in logs back to hidden by [@dskilly]. diff --git a/src/main/java/mdnet/base/ClientSettings.java b/src/main/java/mdnet/base/ClientSettings.java index 0ecc998..0677356 100644 --- a/src/main/java/mdnet/base/ClientSettings.java +++ b/src/main/java/mdnet/base/ClientSettings.java @@ -50,14 +50,14 @@ public final class ClientSettings { } public int getThreadsPerCpu() { - return threadsPerCpu; + return (threadsPerCpu > 0) ? threadsPerCpu : 16; } @Override public String toString() { return "ClientSettings{" + "maxCacheSizeMib=" + maxCacheSizeMib + ", maxBandwidthMibPerHour=" + maxBandwidthMibPerHour + ", maxBurstRateKibPerSecond=" + maxBurstRateKibPerSecond + ", clientPort=" - + clientPort + ", clientSecret='" + "" + '\'' + ", threadsPerCpu=" + threadsPerCpu + '}'; + + clientPort + ", clientSecret='" + "" + '\'' + ", threadsPerCpu=" + getThreadsPerCpu() + '}'; } public static boolean isSecretValid(String clientSecret) {