From a60dce3183ecfbaec3c11441dca24ae218056aaa Mon Sep 17 00:00:00 2001 From: Sizolwakhe Leonard Mthimunye Date: Tue, 9 Sep 2025 09:52:45 +0200 Subject: [PATCH 1/2] We only increase number of threads for members n9t non-members --- .../airpenthouse/GoTel/util/executors/CountriesExecutors.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/airpenthouse/GoTel/util/executors/CountriesExecutors.java b/src/main/java/org/airpenthouse/GoTel/util/executors/CountriesExecutors.java index 97067b4..ec6eeda 100644 --- a/src/main/java/org/airpenthouse/GoTel/util/executors/CountriesExecutors.java +++ b/src/main/java/org/airpenthouse/GoTel/util/executors/CountriesExecutors.java @@ -30,10 +30,10 @@ private ExecutorService determineNoThreadToUse() { Members with registered successful uses more threads than non membership */ if (checkMemberShipStatusAndTokenMatch()) { - final var noProcesses = Runtime.getRuntime().availableProcessors(); + final var noProcesses = Runtime.getRuntime().availableProcessors() * 2; executeCountries = Executors.newFixedThreadPool(noProcesses); } else { - final var noProcesses = Runtime.getRuntime().availableProcessors() * 2; + final var noProcesses = Runtime.getRuntime().availableProcessors() ; executeCountries = Executors.newFixedThreadPool(noProcesses); } return executeCountries; From 7bd0a05c06e7dbd31c963b623c0fa683e1e9f694 Mon Sep 17 00:00:00 2001 From: Sizolwakhe Leonard Mthimunye Date: Tue, 9 Sep 2025 09:54:12 +0200 Subject: [PATCH 2/2] checkMemberShipStatusAndTokenMatch method returns false when user is non member --- .../airpenthouse/GoTel/services/country/CountriesService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/airpenthouse/GoTel/services/country/CountriesService.java b/src/main/java/org/airpenthouse/GoTel/services/country/CountriesService.java index a3833f2..3223528 100644 --- a/src/main/java/org/airpenthouse/GoTel/services/country/CountriesService.java +++ b/src/main/java/org/airpenthouse/GoTel/services/country/CountriesService.java @@ -26,9 +26,9 @@ private Set getAllCountries() { private Set getRequest() { if (checkMemberShipStatusAndTokenMatch()) - return initializeCountriesEntity().stream().map(mapper::mapper).collect(Collectors.toSet()); - else return initializeCountriesEntity().stream().map(mapper::mapToMembershipCountryRequest).collect(Collectors.toSet()); + else + return initializeCountriesEntity().stream().map(mapper::mapper).collect(Collectors.toSet()); } private Set getCountryByName() {