Skip to content

Commit

Permalink
验证同步请求接口方式(加个异步没法同步输出日志)
Browse files Browse the repository at this point in the history
  • Loading branch information
centerzx committed Aug 22, 2022
1 parent 43e2bd6 commit 416e327
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions app/src/main/java/net/center/upload_plugin/UploadTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private void checkPgyUploadBuildInfo(String apiKey, String buildKey) {
}
}

private Timer mTimer;
// private Timer mTimer;

private void pgyUploadBuildInfoTimer(String apiKey, String buildKey) {
System.out.println("buildInfo: upload pgy buildInfo request again(pgyUploadBuildInfoTimer)");
Expand All @@ -340,23 +340,27 @@ private void pgyUploadBuildInfoTimer(String apiKey, String buildKey) {
// e.printStackTrace();
// }
// }, 0, 3, TimeUnit.SECONDS);
//
if (mTimer == null) {
mTimer = new Timer();

// if (mTimer == null) {
// mTimer = new Timer();
// }
// mTimer.schedule(new TimerTask() {
// @Override
// public void run() {
// try {
// System.out.println("buildInfo: upload pgy buildInfo request again");
// checkPgyUploadBuildInfo(apiKey, buildKey);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
// }, 3000);
try {
Thread.sleep(2000);
checkPgyUploadBuildInfo(apiKey, buildKey);
} catch (InterruptedException e) {
e.printStackTrace();
}
mTimer.schedule(new TimerTask() {
@Override
public void run() {
try {
System.out.println("buildInfo: upload pgy buildInfo request again");
checkPgyUploadBuildInfo(apiKey, buildKey);
} catch (Exception e) {
e.printStackTrace();
}
}
}, 3000);
// new Sleep().doSleep(2000);
// checkPgyUploadBuildInfo(apiKey, buildKey);
}


Expand Down

0 comments on commit 416e327

Please sign in to comment.