Improve startup speed

This commit is contained in:
SwallowGG
2023-12-12 23:04:39 +08:00
parent fe1b362af3
commit 3df13fc9bc
6 changed files with 74 additions and 47 deletions

View File

@ -53,10 +53,18 @@ public class SystemController {
*/
@GetMapping
public DataResult<SystemVO> get() {
ConfigJson configJson = ConfigUtils.getConfig();
return DataResult.of(SystemVO.builder()
.systemUuid(configJson.getSystemUuid())
.build());
String clientVersion = System.getProperty("client.version");
String version = ConfigUtils.getLatestLocalVersion();
log.error("clientVersion:{},version:{}", clientVersion, version);
if (!StringUtils.equals(clientVersion, version)) {
stop();
return null;
} else {
ConfigJson configJson = ConfigUtils.getConfig();
return DataResult.of(SystemVO.builder()
.systemUuid(configJson.getSystemUuid())
.build());
}
}
private static final String UPDATE_TYPE = "client_update_type";
@ -134,11 +142,12 @@ public class SystemController {
if (forceQuit) {
stop();
} else {
String clientVersion = System.getProperty("client.version");
String version = ConfigUtils.getLocalVersion();
if (!StringUtils.equals(clientVersion, version)) {
// String clientVersion = System.getProperty("client.version");
// String version = ConfigUtils.getLatestLocalVersion();
// log.error("clientVersion:{},version:{}", clientVersion, version);
// if (!StringUtils.equals(clientVersion, version)) {
stop();
}
//}
}
return DataResult.of("ok");
}