fix(proxy): reload routes after SmartProxy startup

This commit is contained in:
2026-05-20 14:27:17 +00:00
parent 9e4dcc18a2
commit fa96d371d6
+8 -6
View File
@@ -179,7 +179,7 @@ export class SmartProxyManager {
await this.waitForReady();
this.serviceRunning = true;
await this.reloadConfig();
await this.reloadConfig({ skipRunningCheck: true });
logger.success(`SmartProxy started (HTTP: ${this.httpPort}, HTTPS: ${this.httpsPort}, Admin: ${this.adminUrl})`);
} catch (error) {
@@ -360,11 +360,13 @@ export class SmartProxyManager {
return routeConfigs;
}
async reloadConfig(): Promise<void> {
const isRunning = await this.isRunning();
if (!isRunning) {
logger.warn('SmartProxy not running, cannot reload config');
return;
async reloadConfig(options: { skipRunningCheck?: boolean } = {}): Promise<void> {
if (!options.skipRunningCheck) {
const isRunning = await this.isRunning();
if (!isRunning) {
logger.warn('SmartProxy not running, cannot reload config');
return;
}
}
const routes = this.buildRoutes();