Skip to content
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 @@ -8,6 +8,7 @@
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

import java.time.Duration;
Expand All @@ -28,7 +29,14 @@ public class SlackApiService {
@Value("${slack.bot-token}")
private String botToken;

private final RestTemplate restTemplate = new RestTemplate();
private final RestTemplate restTemplate = createRestTemplate();

private static RestTemplate createRestTemplate() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(3_000);
Comment on lines +32 to +36
factory.setReadTimeout(5_000);
return new RestTemplate(factory);
}
Comment on lines +34 to +39
private final RedisTemplate<String, Object> redisTemplate;

private static final String SLACK_USERS_CACHE_KEY = "slack:cache:users:list";
Expand Down