Skip to content

Commit 89325e8

Browse files
authored
Merge pull request #162 from yvasyliev/dev
Increased timeout for HTTP calls
2 parents 6480a4f + 72248ed commit 89325e8

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

.github/workflows/build-maven-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
- name: Set up JDK 8
13-
uses: actions/setup-java@v2
13+
uses: actions/setup-java@v3
1414
with:
1515
java-version: '8'
1616
distribution: 'adopt'

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v2
41+
uses: actions/checkout@v3
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
45+
uses: github/codeql-action/init@v2
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
5555
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
56+
uses: github/codeql-action/autobuild@v2
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
6767
# make release
6868

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
70+
uses: github/codeql-action/analyze@v2

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)