Commit e9f2136f by pye52

1、更新文档,增加客户端上传日志的指令说明

2、去掉离线支付的时间间隔限制(每次重连完毕都会尝试扫描离线订单)
3、更新第三方库版本
parent 71ca66c6
......@@ -116,7 +116,7 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "org.java-websocket:Java-WebSocket:1.5.1"
implementation 'com.blankj:utilcodex:1.28.4'
implementation 'com.blankj:utilcodex:1.29.0'
def okhttp_version = "4.6.0"
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
......
......@@ -103,21 +103,11 @@ public class PayOfflineViewModel extends ViewModel {
private static final String RESPONSE_SUCCESS = "0";
// 每心跳多少次后进行一次离线订单检测
private static final int PAY_OFFLINE_CHECK = 30;
// 当链接频繁断开时,给予离线订单检测一定缓冲时间
private static final long PAY_OFFLINE_INTERVAL = 30 * 60 * 1000;
private long lastPayTime = -1;
private int heartbeatCount = 0;
@Override
public void onOpen(ServerHandshake data) {
heartbeatCount = 0;
long currentTime = System.currentTimeMillis();
if ((currentTime - lastPayTime) < PAY_OFFLINE_INTERVAL) {
LogUtils.w(TAG, "离线检测过于频繁,可能是链接频繁断开导致");
return;
}
lastPayTime = currentTime;
traversalPayOfflineData();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment