Skip to content

Commit 3064817

Browse files
committed
+ Changes based on feedback
1 parent 89bf007 commit 3064817

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/main/java/Api/SearchTransactionsApi.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,14 @@ public TssV2TransactionsPost201Response createSearch(CreateSearchRequest createS
142142
this.apiClient.setComputationStartTime(System.nanoTime());
143143
ApiResponse<TssV2TransactionsPost201Response> resp = createSearchWithHttpInfo(createSearchRequest);
144144
logger.info("CALL TO METHOD 'createSearch' ENDED");
145-
if(resp == null)
145+
if(resp != null)
146146
{
147+
return resp.getData();
148+
}
149+
else {
147150
logger.info("CALL TO METHOD 'createSearch' FAILED DUE TO AN EXCEPTION");
148151
return null;
149152
}
150-
return resp.getData();
151153
}
152154

153155
/**

src/main/java/Invokers/ApiClient.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public class ApiClient {
138138

139139
private JSON json;
140140
private String versionInfo;
141-
private static ConnectionPool defaultConnectionPool = new ConnectionPool(5, 10, TimeUnit.SECONDS);
141+
private static ConnectionPool connectionPool = new ConnectionPool(5, 10, TimeUnit.SECONDS);
142142
private HttpLoggingInterceptor loggingInterceptor;
143143
private long computationStartTime;
144144
private static Logger logger = LogManager.getLogger(ApiClient.class);
@@ -165,7 +165,7 @@ public static OkHttpClient initializeFinalVariables() {
165165
.connectTimeout(1, TimeUnit.SECONDS)
166166
.writeTimeout(60, TimeUnit.SECONDS)
167167
.readTimeout(60, TimeUnit.SECONDS)
168-
.connectionPool(ApiClient.defaultConnectionPool)
168+
.connectionPool(ApiClient.connectionPool)
169169
.addInterceptor(logging)
170170
.build();
171171
}
@@ -245,7 +245,7 @@ public ApiClient(MerchantConfig merchantConfig) {
245245
int readTimeout = Math.max(merchantConfig.getUserDefinedReadTimeout(), 60);
246246
int writeTimeout = Math.max(merchantConfig.getUserDefinedWriteTimeout(), 60);
247247
int keepAliveDuration = Math.max(merchantConfig.getUserDefinedKeepAliveDuration(), 10);
248-
ConnectionPool connectionPool = new ConnectionPool(5, keepAliveDuration, TimeUnit.SECONDS);
248+
connectionPool = new ConnectionPool(5, keepAliveDuration, TimeUnit.SECONDS);
249249

250250
Authenticator proxyAuthenticator;
251251

@@ -288,7 +288,7 @@ public Request authenticate(Route route, Response response) throws IOException {
288288
.readTimeout(readTimeout, TimeUnit.SECONDS)
289289
.retryOnConnectionFailure(true)
290290
.addInterceptor(new RetryInterceptor(this.apiRequestMetrics))
291-
.connectionPool(connectionPool)
291+
.connectionPool(ApiClient.connectionPool)
292292
.eventListener(new NetworkEventListener(this.getNewRandomId(), System.nanoTime()))
293293
.build();
294294
}
@@ -307,7 +307,7 @@ public Request authenticate(Route route, Response response) throws IOException {
307307
.connectTimeout(connectionTimeout, TimeUnit.SECONDS)
308308
.writeTimeout(writeTimeout, TimeUnit.SECONDS)
309309
.readTimeout(readTimeout, TimeUnit.SECONDS)
310-
.connectionPool(connectionPool)
310+
.connectionPool(ApiClient.connectionPool)
311311
.retryOnConnectionFailure(true)
312312
.addInterceptor(new RetryInterceptor(this.apiRequestMetrics))
313313
.eventListener(new NetworkEventListener(this.getNewRandomId(), System.nanoTime()))

0 commit comments

Comments
 (0)