fix(smart-proxy): start metrics polling before certificate provisioning to avoid blocking metrics collection

This commit is contained in:
2026-02-14 12:42:20 +00:00
parent d6fdd3fc86
commit 487a603fa3
3 changed files with 15 additions and 5 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartproxy',
version: '25.2.1',
version: '25.2.2',
description: 'A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.'
}

View File

@@ -191,13 +191,16 @@ export class SmartProxy extends plugins.EventEmitter {
}
}
// Handle certProvisionFunction
await this.provisionCertificatesViaCallback(preloadedDomains);
// Start metrics polling
// Start metrics polling BEFORE cert provisioning — the Rust engine is already
// running and accepting connections, so metrics should be available immediately.
// Cert provisioning can hang indefinitely (e.g. DNS-01 ACME timeouts) and must
// not block metrics collection.
this.metricsAdapter.startPolling();
logger.log('info', 'SmartProxy started (Rust engine)', { component: 'smart-proxy' });
// Handle certProvisionFunction (may be slow — runs after startup is complete)
await this.provisionCertificatesViaCallback(preloadedDomains);
}
/**