Skip to content

Commit 7399c7f

Browse files
committed
Improve startup speed
1 parent 8b0cbb4 commit 7399c7f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

  • chat2db-client/src/main
  • chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/system

chat2db-client/src/main/preload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ contextBridge.exposeInMainWorld('electronApi', {
1717

1818
const child = spawn(path.join(__dirname, '../..', `./static/${JAVA_PATH}`), [
1919
'-noverify',
20-
'-jar',
21-
'-Xmx1024M',
2220
`-Dspring.profiles.active=${isTest ? 'test' : 'release'}`,
2321
'-Dserver.address=127.0.0.1',
2422
'-Dchat2db.mode=DESKTOP',
2523
`-Dproject.path=${javaPath}`,
2624
`-Dloader.path=${libPath}`,
2725
`-Dclient.version=${readVersion()}`,
26+
'-Xmx1024M',
27+
'-jar',
2828
javaPath,
2929
]);
3030

chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/system/SystemController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public DataResult<SystemVO> get() {
5656
String clientVersion = System.getProperty("client.version");
5757
String version = ConfigUtils.getLatestLocalVersion();
5858
log.error("clientVersion:{},version:{}", clientVersion, version);
59-
if (!StringUtils.equals(clientVersion, version)) {
59+
if (!StringUtils.equals(clientVersion, version) && !StringUtils.isEmpty(clientVersion)) {
6060
stop();
6161
return null;
6262
} else {
@@ -146,7 +146,7 @@ public DataResult<String> stop(boolean forceQuit) {
146146
// String version = ConfigUtils.getLatestLocalVersion();
147147
// log.error("clientVersion:{},version:{}", clientVersion, version);
148148
// if (!StringUtils.equals(clientVersion, version)) {
149-
stop();
149+
stop();
150150
//}
151151
}
152152
return DataResult.of("ok");

0 commit comments

Comments
 (0)