fix(smart-proxy): start metrics polling before certificate provisioning to avoid blocking metrics collection
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user