fix(proxy): reload routes after SmartProxy startup
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user