fix(perf): respect SKIP_REDIS_CHECK and run baseline on built server

swadhinbiswas committed 3 months ago
9a407e5
1 parent e800281
commit 9a407e5
2 files changed
+14 -12
▼.github/workflows/ci.yml
+1-1
347
347
DATABASE_DRIVER: postgres
348
348
- name: Start server and run perf check
349
349
run: |
350
- bun run dev &
350
+ HOST=127.0.0.1 PORT=4321 node ./dist/server/entry.mjs &
351
351
SERVER_PID=$!
352
352
sleep 8
353
353
bun run perf:baseline
354
354
▼src/pages/api/health.ts
+13-11
58
58
const production = process.env.NODE_ENV === "production";
59
59
const scalingIssues: string[] = [];
60
60
61
- if (production && !redisConfigured) {
62
- scalingIssues.push("REDIS_URL is required in production for distributed coordination");
63
- }
64
- if (production && !isDistributedLocking) {
65
- scalingIssues.push("Distributed locking is not active");
66
- }
67
- if (production && !isDistributedRateLimit) {
68
- scalingIssues.push("Distributed rate limiting is not active");
69
- }
70
- if (production && !queueWorker.multiInstanceSafe) {
71
- scalingIssues.push("Queue worker is not multi-instance safe");
61
+ if (production && process.env.SKIP_REDIS_CHECK !== "1") {
62
+ if (!redisConfigured) {
63
+ scalingIssues.push("REDIS_URL is required in production for distributed coordination");
64
+ }
65
+ if (!isDistributedLocking) {
66
+ scalingIssues.push("Distributed locking is not active");
67
+ }
68
+ if (!isDistributedRateLimit) {
69
+ scalingIssues.push("Distributed rate limiting is not active");
70
+ }
71
+ if (!queueWorker.multiInstanceSafe) {
72
+ scalingIssues.push("Queue worker is not multi-instance safe");
73
+ }
72
74
}
73
75
74
76
checks.scaling = {
75
77