update:增加ws连接时长,避免ws时间过短到只conn对象销毁丢失无法使用

This commit is contained in:
hrz
2025-05-21 10:43:48 +08:00
parent b8da0714c2
commit bc6c85c6c6
3 changed files with 11 additions and 8 deletions
@@ -89,7 +89,7 @@ public class ServerSideManageController {
try (WebSocketClientManager client = new WebSocketClientManager.Builder()
.connectTimeout(3, TimeUnit.SECONDS)
.maxSessionDuration(5, TimeUnit.SECONDS)
.maxSessionDuration(120, TimeUnit.SECONDS)
.uri(targetWsUri)
.headers(headers)
.build()) {
@@ -104,8 +104,9 @@ public class ServerSideManageController {
return false;
}
try {
return ServerActionResponseDTO
.isSuccess(objectMapper.readValue(jsonText, ServerActionResponseDTO.class));
ServerActionResponseDTO response = objectMapper.readValue(jsonText, ServerActionResponseDTO.class);
Boolean isSuccess = ServerActionResponseDTO.isSuccess(response);
return isSuccess;
} catch (JsonProcessingException e) {
return false;
}