fix: XCOpenCodeWeb 启动时传入端口参数 --port 3002
This commit is contained in:
@@ -41,6 +41,10 @@ class XCOpenCodeWebService {
|
|||||||
return path.join(basePath, 'services', 'xcopencodeweb', exeName);
|
return path.join(basePath, 'services', 'xcopencodeweb', exeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getExeArgs(): string[] {
|
||||||
|
return ['--port', this.port.toString()];
|
||||||
|
}
|
||||||
|
|
||||||
private async checkHealth(): Promise<boolean> {
|
private async checkHealth(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
@@ -79,9 +83,10 @@ class XCOpenCodeWebService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const exePath = this.getExePath();
|
const exePath = this.getExePath();
|
||||||
log.info(`[XCOpenCodeWebService] Starting from: ${exePath}`);
|
const exeArgs = this.getExeArgs();
|
||||||
|
log.info(`[XCOpenCodeWebService] Starting from: ${exePath} with args: ${exeArgs.join(' ')}`);
|
||||||
|
|
||||||
this.process = spawn(exePath, [], {
|
this.process = spawn(exePath, exeArgs, {
|
||||||
stdio: 'pipe',
|
stdio: 'pipe',
|
||||||
shell: true,
|
shell: true,
|
||||||
detached: false,
|
detached: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user