perf(cmpp): add durable inbound fast path
This commit is contained in:
@@ -4,6 +4,7 @@ import { resolve } from 'node:path';
|
||||
const deploy = readFileSync(resolve(import.meta.dirname, 'production-deploy.sh'), 'utf8');
|
||||
const bootstrap = readFileSync(resolve(import.meta.dirname, 'production-bootstrap.sh'), 'utf8');
|
||||
const apiMain = readFileSync(resolve(import.meta.dirname, '../../api/src/main.ts'), 'utf8');
|
||||
const workerMain = readFileSync(resolve(import.meta.dirname, '../../api/src/send-worker.ts'), 'utf8');
|
||||
const required = [
|
||||
'compression_config=/etc/nginx/conf.d/cmpp-compression.conf',
|
||||
': >"$compression_config"',
|
||||
@@ -26,4 +27,22 @@ if (!apiMain.includes("process.env.API_HOST?.trim() || '127.0.0.1'") || !apiMain
|
||||
throw new Error('NestJS API must bind to API_HOST and default to loopback');
|
||||
}
|
||||
|
||||
console.log('Production deployment verified: Nginx compression is idempotent and NestJS defaults to loopback.');
|
||||
for (const marker of [
|
||||
'CMPP_INBOUND_FAST_PATH_ENABLED=true',
|
||||
'CMPP_INBOUND_WORKFLOW_WORKER_ENABLED=true',
|
||||
'API_INBOUND_WORKFLOW_CONCURRENCY',
|
||||
'cmpp-send-worker.service',
|
||||
'Environment=CMPP_PROCESS_ROLE=api',
|
||||
'Environment=CMPP_PROCESS_ROLE=worker',
|
||||
'dist/send-worker.js',
|
||||
'API_WORKER_METRICS_PORT',
|
||||
]) {
|
||||
if (!`${deploy}\n${bootstrap}`.includes(marker)) {
|
||||
throw new Error(`production deployment is missing the durable inbound worker contract: ${marker}`);
|
||||
}
|
||||
}
|
||||
if (!workerMain.includes("process.env.API_WORKER_METRICS_HOST?.trim() || '127.0.0.1'")) {
|
||||
throw new Error('send worker metrics must default to loopback');
|
||||
}
|
||||
|
||||
console.log('Production deployment verified: Nginx/API guards and the split durable send worker contract are present.');
|
||||
|
||||
Reference in New Issue
Block a user