fix: clean up SmartProxy lifecycle

This commit is contained in:
2026-04-28 21:59:00 +00:00
parent c5d9158078
commit 5cb6895a14
5 changed files with 19 additions and 11 deletions
+2 -5
View File
@@ -130,12 +130,9 @@ export class OneboxReverseProxy {
/**
* Remove a route
*/
removeRoute(domain: string): void {
async removeRoute(domain: string): Promise<void> {
if (this.routes.delete(domain)) {
// Remove from SmartProxy (async but we don't wait)
this.smartProxy.removeRoute(domain).catch((error) => {
logger.error(`Failed to remove SmartProxy route for ${domain}: ${getErrorMessage(error)}`);
});
await this.smartProxy.removeRoute(domain);
logger.success(`Removed proxy route: ${domain}`);
} else {
logger.warn(`Route not found: ${domain}`);