Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Senk KRR okHttp timeout til 1 sek #687

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.extern.slf4j.Slf4j;
import no.nav.common.health.HealthCheckResult;
import no.nav.common.health.HealthCheckUtils;
import no.nav.common.rest.client.LogRequestInterceptor;
import no.nav.common.rest.client.RestClient;
import no.nav.common.rest.client.RestUtils;
import no.nav.common.types.identer.Fnr;
Expand All @@ -15,6 +16,7 @@
import org.springframework.cache.annotation.Cacheable;

import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

import static java.util.Optional.empty;
Expand All @@ -41,7 +43,13 @@ public DigdirClientImpl(String digdirUrl, Supplier<String> systemUserTokenProvid
this.systemUserTokenProvider = systemUserTokenProvider;
this.userTokenProvider = userTokenProvider;
this.authService = authService;
this.client = RestClient.baseClient();
this.client = new OkHttpClient.Builder()
.addInterceptor(new LogRequestInterceptor())
.connectTimeout(1, TimeUnit.SECONDS)
.readTimeout(5, TimeUnit.SECONDS)
.writeTimeout(5, TimeUnit.SECONDS)
.followRedirects(false)
.build();
}

@Cacheable(CacheConfig.DIGDIR_KONTAKTINFO_CACHE_NAME)
Expand Down
Loading