Commit 0ec88f97 by pye52

Merge branch 'new_master' into new_master_install_by_daemon

parents 5cf16966 ab43b7e8
...@@ -41,7 +41,7 @@ public class LogCommandHandler extends CommandHandler { ...@@ -41,7 +41,7 @@ public class LogCommandHandler extends CommandHandler {
private static final long DEFAULT_DELAY = 1000; private static final long DEFAULT_DELAY = 1000;
private volatile boolean start = false; private volatile boolean start = false;
private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
private String deviceSN; private String deviceSN;
private CommandLog commandLog; private CommandLog commandLog;
...@@ -182,10 +182,10 @@ public class LogCommandHandler extends CommandHandler { ...@@ -182,10 +182,10 @@ public class LogCommandHandler extends CommandHandler {
OkHttpClient client = SCRetrofit.createOkHttpClient().build(); OkHttpClient client = SCRetrofit.createOkHttpClient().build();
SCApi api = SCRetrofit.createApi(client); SCApi api = SCRetrofit.createApi(client);
CommandLog.CommandLogData data = commandLog.getData(); CommandLog.CommandLogData data = commandLog.getData();
String fileNameForServer = data.getLogType() + String fileNameForServer = data.getLogType()
"_" + format.format(startTime) + + format.format(startTime)
"_" + format.format(endTime) + + format.format(endTime)
"_" + deviceSN + ".zip"; + deviceSN + ".zip";
fileNameForServer = fileNameForServer.replace(" ", "_"); fileNameForServer = fileNameForServer.replace(" ", "_");
LogUtils.d(TAG, "开始上传日志: " + fileNameForServer); LogUtils.d(TAG, "开始上传日志: " + fileNameForServer);
RequestBody requestBody = RequestBody.create(zip, MediaType.parse("application/x-zip-compressed")); RequestBody requestBody = RequestBody.create(zip, MediaType.parse("application/x-zip-compressed"));
......
...@@ -76,6 +76,7 @@ public class SCWebSocketClient extends WebSocketClient { ...@@ -76,6 +76,7 @@ public class SCWebSocketClient extends WebSocketClient {
forceStop = false; forceStop = false;
SCTaskExecutor.getInstance().executeOnDiskIO(() -> { SCTaskExecutor.getInstance().executeOnDiskIO(() -> {
try { try {
connectState.postValue(new ConnectState(ConnectState.CONNECTING));
boolean connectResult = connectBlocking(10, TimeUnit.SECONDS); boolean connectResult = connectBlocking(10, TimeUnit.SECONDS);
if (connectResult) { if (connectResult) {
connectState.postValue(new ConnectState(ConnectState.CONNECTED, host.toString())); connectState.postValue(new ConnectState(ConnectState.CONNECTED, host.toString()));
......
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