feat:配置修改,bug修改
parent
598acecab5
commit
917fc25027
|
|
@ -5,7 +5,7 @@ file:
|
|||
upload:
|
||||
temp-dir: /var/lib/vdi/tmp/chunked-uploads
|
||||
dir: /var/lib/vdi/test
|
||||
bt-url: http://10.100.51.86:8114
|
||||
bt-url: http://10.100.51.179:8114
|
||||
tool:
|
||||
dir: /vms/tool/iso
|
||||
spring:
|
||||
|
|
@ -50,7 +50,7 @@ mybatis-plus:
|
|||
grpc:
|
||||
server:
|
||||
# 指定Grpc暴露的端口,后续客户端通过这个端口访问
|
||||
port: 51051
|
||||
port: 50051
|
||||
|
||||
# Feign 配置
|
||||
feign:
|
||||
|
|
@ -70,6 +70,6 @@ logging:
|
|||
com.unisinsight.project.feign.ExternalApiClient: debug
|
||||
external:
|
||||
api:
|
||||
url: http://10.100.51.178:8000
|
||||
url: http://10.100.51.179:8000
|
||||
torrent:
|
||||
url: http://10.100.51.178:8114
|
||||
url: http://10.100.51.179:8114
|
||||
|
|
@ -34,6 +34,7 @@ public class DeskImageController {
|
|||
public Double start(@RequestParam("name") String name) {
|
||||
System.out.println("查询进度");
|
||||
Map<String, Object> resultMap = ImageVirtualUtils.progress(name);
|
||||
|
||||
// 使用log打印Map内容
|
||||
if (resultMap != null) {
|
||||
log.info("进度信息详情:");
|
||||
|
|
@ -44,9 +45,28 @@ public class DeskImageController {
|
|||
} else {
|
||||
log.warn("未获取到进度信息,resultMap为null");
|
||||
}
|
||||
|
||||
if (resultMap != null && resultMap.get("progress") != null) {
|
||||
//
|
||||
return (Double) resultMap.get("progress");
|
||||
Object progressObj = resultMap.get("progress");
|
||||
|
||||
// 类型安全的转换
|
||||
if (progressObj instanceof Double) {
|
||||
return (Double) progressObj;
|
||||
} else if (progressObj instanceof Integer) {
|
||||
return ((Integer) progressObj).doubleValue();
|
||||
} else if (progressObj instanceof Number) {
|
||||
return ((Number) progressObj).doubleValue();
|
||||
} else if (progressObj instanceof String) {
|
||||
try {
|
||||
return Double.parseDouble((String) progressObj);
|
||||
} catch (NumberFormatException e) {
|
||||
log.warn("无法解析进度值: {}", progressObj);
|
||||
return 0.0;
|
||||
}
|
||||
} else {
|
||||
log.warn("未知的进度值类型: {}", progressObj.getClass().getSimpleName());
|
||||
return 0.0;
|
||||
}
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue