Skip to content

Commit

Permalink
- 增加本地(sqlite)存储方式
Browse files Browse the repository at this point in the history
- 网络请求超时时间修正
- 修复控制台Connection reset报错
  • Loading branch information
meteorOSS committed Dec 13, 2023
1 parent 0b23c8a commit 9c610ce
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.meteor</groupId>
<artifactId>AifadianPay</artifactId>
<version>3.2-SNAPSHOT</version>
<version>3.3-SNAPSHOT</version>
<packaging>jar</packaging>

<name>AifadianPay</name>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/meteor/aifadianpay/afdian/AfadianApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ public QueryOrderResponse toOrders(PackHttpResponse packHttpResponse){
if(AifadianPay.debug){
AifadianPay.INSTANCE.getLogger().info("返回状态码: "+queryOrderResponse.getEc());
}
packHttpResponse.close();
return queryOrderResponse;
}


/**
* 异步请求订单
* @param afdOrderReq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import com.meteor.aifadianpay.afdian.AfadianApi;
import com.meteor.aifadianpay.afdian.response.Orders;
import com.meteor.aifadianpay.afdian.response.QueryOrderResponse;
import com.meteor.aifadianpay.httputil.callback.AsyncHttpResponseCallBack;
import com.meteor.aifadianpay.httputil.response.PackHttpResponse;
import com.meteor.aifadianpay.storage.IStorage;

public class HandlerQueryOrdersResponse{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ public boolean isSuccess(){
关闭实体输入流
*/
@Override
public void close() throws Exception {
httpResponse.getEntity().getContent().close();
public void close() {
try {
httpResponse.getEntity().getContent().close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/meteor/aifadianpay/util/BaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void reload(){
}

public int getHttpTimeout(){
return plugin.getConfig().getInt("timeout",8)*1000;
return plugin.getConfig().getInt("timeout",30)*1000;
}


Expand Down
9 changes: 5 additions & 4 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ token: ''
# 数据库信息 (推荐启用)
mysql-info:
ip: '127.0.0.1'
# 是否启用
enable: false
port: 3306
param: 'useSsl=false'
param: 'useSSL=false&serverTimezone=Asia/Shanghai'
user: 'root'
password: 'mmeteor233'
database: 'minecraft'
password: '不告诉你'
database: 'server01'
validSql: 'show databases'

# 该选项控制多久开始查询一次订单
Expand All @@ -24,4 +25,4 @@ query-cron: '0 0/2 * * * ?'
debug: false

# 网络请求超时时间 (秒)
timeout: 10
timeout: 30

0 comments on commit 9c610ce

Please sign in to comment.