diff --git a/ts/classes/smartproxy.ts b/ts/classes/smartproxy.ts index d0fb074..f8705d6 100644 --- a/ts/classes/smartproxy.ts +++ b/ts/classes/smartproxy.ts @@ -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 { - const isRunning = await this.isRunning(); - if (!isRunning) { - logger.warn('SmartProxy not running, cannot reload config'); - return; + async reloadConfig(options: { skipRunningCheck?: boolean } = {}): Promise { + if (!options.skipRunningCheck) { + const isRunning = await this.isRunning(); + if (!isRunning) { + logger.warn('SmartProxy not running, cannot reload config'); + return; + } } const routes = this.buildRoutes();