Skip to content

Commit 72248ed

Browse files
committed
increased timeout for HTTP calls
1 parent 790711c commit 72248ed

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This library uses the next third-party dependencies:
5050
<dependency>
5151
<groupId>com.github.yvasyliev</groupId>
5252
<artifactId>java-vk-bots-longpoll-api</artifactId>
53-
<version>4.1.1</version>
53+
<version>4.1.2</version>
5454
</dependency>
5555
```
5656
4. Extend `LongPollBot` class and override necessary methods:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>com.github.yvasyliev</groupId>
77
<artifactId>java-vk-bots-longpoll-api</artifactId>
88
<packaging>jar</packaging>
9-
<version>4.1.1</version>
9+
<version>4.1.2</version>
1010
<name>Java VK Bots Long Poll API</name>
1111
<description>A Java library to create VK bots using Bots Long Poll API</description>
1212
<url>https://github.com/yvasyliev/java-vk-bots-long-poll-api</url>

src/main/java/api/longpoll/bots/methods/impl/VkMethod.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public abstract class VkMethod<VkResponse> {
3434
*/
3535
private static final Logger LOGGER = LoggerFactory.getLogger(VkMethod.class);
3636

37+
/**
38+
* Timeout for HTTP calls.
39+
*/
40+
private static final int DEFAULT_TIMEOUT = 60;
41+
3742
/**
3843
* Validator to check if VK API response is valid.
3944
*/
@@ -58,8 +63,8 @@ public abstract class VkMethod<VkResponse> {
5863
* HTTP client.
5964
*/
6065
private final OkHttpClient okHttpClient = new OkHttpClient.Builder()
61-
.callTimeout(32, TimeUnit.SECONDS)
62-
.readTimeout(32, TimeUnit.SECONDS)
66+
.callTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS)
67+
.readTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS)
6368
.addInterceptor(new LoggerInterceptor(LOGGER))
6469
.build();
6570

0 commit comments

Comments
 (0)