|
@@ -90,6 +90,7 @@ import java.util.HashMap;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.Future;
|
|
|
|
|
|
import io.reactivex.Observable;
|
|
|
import io.reactivex.Observer;
|
|
@@ -909,7 +910,7 @@ public class BackgroundService extends Service {
|
|
|
startDownloadApk(mBean);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ private Future future;
|
|
|
private void uploadLogFileList(ServerActionBean serverActionBean) {
|
|
|
List<String> waitUploadLogPaths = serverActionBean.getPaths();
|
|
|
if (waitUploadLogPaths == null || waitUploadLogPaths.size() == 0) {
|
|
@@ -924,10 +925,14 @@ public class BackgroundService extends Service {
|
|
|
|
|
|
String logType = serverActionBean.getLogType();
|
|
|
String sender = serverActionBean.getSender();
|
|
|
- ThreadPoolManager.getInstance().executeIOTask(new Runnable() {
|
|
|
+ if (future != null && !future.isDone()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ future= ThreadPoolManager.getInstance().sumbitIOTask(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
+ AppLogUtils.e("下载run"+waitUploadLogPaths);
|
|
|
synchronized (BackgroundService.class) {
|
|
|
String zipPath = ZipUtils.createZipFolder(MyApplication.getContext(), waitUploadLogPaths);
|
|
|
String downloadUrl = ChunkedUploadExample.uploadFile(MyApplication.getContext(), zipPath);
|
|
@@ -937,11 +942,11 @@ public class BackgroundService extends Service {
|
|
|
reportLogList(DOWNLOAD_LOG, downLoadUrls, logType, sender);
|
|
|
}
|
|
|
}catch (IOException e){
|
|
|
-
|
|
|
+ AppLogUtils.e(e.toString());
|
|
|
}catch (OutOfMemoryError e2){
|
|
|
-
|
|
|
+ AppLogUtils.e(e2.toString());
|
|
|
}catch (Exception e3){
|
|
|
-
|
|
|
+ AppLogUtils.e(e3.toString());
|
|
|
}
|
|
|
|
|
|
}
|