Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
revert api timeout and increase for search
Browse files Browse the repository at this point in the history
closes #881
  • Loading branch information
sk22 committed Oct 20, 2023
1 parent 183fb0e commit daafb51
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public class MastodonAPIController{
.registerTypeAdapter(Status.class, new Status.StatusDeserializer())
.create();
private static WorkerThread thread=new WorkerThread("MastodonAPIController");
private static OkHttpClient httpClient=new OkHttpClient.Builder()
.readTimeout(5, TimeUnit.MINUTES)
.build();
private static OkHttpClient httpClient=new OkHttpClient.Builder().build();

private AccountSession session;
private static List<String> badDomains = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ protected void addHeader(String key, String value){
headers.put(key, value);
}

protected void setTimeout(long timeout){
public MastodonAPIRequest<T> setTimeout(long timeout){
this.timeout=timeout;
return this;
}

protected String getPathPrefix(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public void onSuccess(SearchResults result){
recentsHeader.setVisible(false);
}
})
.setTimeout(180000) // 3 minutes (searches can take a long time)
.exec(accountID);
}
}
Expand Down

0 comments on commit daafb51

Please sign in to comment.