aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/config')
-rw-r--r--src/main/java/com/juick/config/HttpClientConfig.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/juick/config/HttpClientConfig.java b/src/main/java/com/juick/config/HttpClientConfig.java
index 457a63c8..2540f4db 100644
--- a/src/main/java/com/juick/config/HttpClientConfig.java
+++ b/src/main/java/com/juick/config/HttpClientConfig.java
@@ -18,6 +18,7 @@
package com.juick.config;
import com.juick.util.ActivityPubRequestInterceptor;
+import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import org.slf4j.Logger;
@@ -27,6 +28,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.inject.Inject;
+import java.util.concurrent.Executors;
@Configuration
public class HttpClientConfig {
@@ -36,6 +38,7 @@ public class HttpClientConfig {
@Bean
public OkHttpClient httpClient() {
return new OkHttpClient.Builder()
+ .dispatcher(new Dispatcher(Executors.newFixedThreadPool(1)))
.addInterceptor(new HttpLoggingInterceptor(logger::debug)
.setLevel(HttpLoggingInterceptor.Level.BASIC))
.addInterceptor(new ActivityPubRequestInterceptor())