Commit 08f83b07 by pye52

Merge branch 'new_master' into new_for_phone

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