Increase default HTTP timeouts to 30 seconds

fixes #751
This commit is contained in:
Grishka 2023-11-27 20:30:33 +03:00
parent d1aba87e13
commit b283e216a7
1 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,11 @@ public class MastodonAPIController{
.registerTypeAdapter(LocalDate.class, new IsoLocalDateTypeAdapter())
.create();
private static WorkerThread thread=new WorkerThread("MastodonAPIController");
private static OkHttpClient httpClient=new OkHttpClient.Builder().build();
private static OkHttpClient httpClient=new OkHttpClient.Builder()
.connectTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.build();
private AccountSession session;