dev add config for nginx
Test Workflow / test (push) Successful in 2s

This commit is contained in:
vladp
2026-03-11 15:29:10 +07:00
parent 54db3d78b4
commit 7fb96d4b51
@@ -27,24 +27,9 @@ public class SearchImageService {
private final ObjectMapper objectMapper; private final ObjectMapper objectMapper;
// private final OkHttpClient httpClient;
private final OkHttpClient yandexHttpClient; private final OkHttpClient yandexHttpClient;
private final OkHttpClient googleHttpClient;
// public SearchImageService() { private final OkHttpClient googleHttpClient;
// this.httpClient = new OkHttpClient.Builder()
// .connectTimeout(18, TimeUnit.SECONDS)
// .writeTimeout(18, TimeUnit.SECONDS)
// .readTimeout(18, TimeUnit.SECONDS)
// .callTimeout(18, TimeUnit.SECONDS)
// .followRedirects(true)
// .followSslRedirects(true)
// .retryOnConnectionFailure(true)
// .connectionPool(new ConnectionPool(0, 1, TimeUnit.NANOSECONDS))
// .build();
//
// this.objectMapper = new ObjectMapper();
// }
public SearchImageService() { public SearchImageService() {
Proxy proxy = new Proxy(Proxy.Type.HTTP, Proxy proxy = new Proxy(Proxy.Type.HTTP,
@@ -59,7 +44,6 @@ public class SearchImageService {
.followRedirects(true) .followRedirects(true)
.followSslRedirects(true) .followSslRedirects(true)
.retryOnConnectionFailure(true) .retryOnConnectionFailure(true)
// .protocols(Arrays.asList(Protocol.HTTP_1_1))
.connectionPool(new ConnectionPool(0, 1, TimeUnit.NANOSECONDS)) .connectionPool(new ConnectionPool(0, 1, TimeUnit.NANOSECONDS))
.build(); .build();
@@ -72,7 +56,6 @@ public class SearchImageService {
.followRedirects(true) .followRedirects(true)
.followSslRedirects(true) .followSslRedirects(true)
.retryOnConnectionFailure(true) .retryOnConnectionFailure(true)
// .protocols(Arrays.asList(Protocol.HTTP_1_1))
.connectionPool(new ConnectionPool(0, 1, TimeUnit.NANOSECONDS)) .connectionPool(new ConnectionPool(0, 1, TimeUnit.NANOSECONDS))
.build(); .build();
@@ -154,14 +137,6 @@ public class SearchImageService {
.header("User-Agent", "Mozilla/5.0") .header("User-Agent", "Mozilla/5.0")
.build(); .build();
// Request request = new Request.Builder()
// .url(url)
// .header("Accept", "*/*")
// .header("User-Agent", "PostmanRuntime/7.29.2")
// .header("Accept-Encoding", "gzip, deflate")
// .header("Connection", "keep-alive")
// .build();
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
try (Response response = client.newCall(request).execute()) { try (Response response = client.newCall(request).execute()) {