Skip to content

Commit 645d812

Browse files
committed
removed overly aggressive healthchecking and replaced with one more simple. Repaired some routes for support
1 parent 831c68c commit 645d812

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

backend/src/index.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,8 @@ app.get("/health", async (req, res) => {
121121
});
122122

123123
app.get("/api/health", async (req, res) => {
124-
try {
125-
await initializeServices();
126-
const healthStatus = await healthCheckService.performEnhancedHealthCheck();
127-
const statusCode = healthStatus.status === "healthy" ? 200 : 503;
128-
res.status(statusCode).json(healthStatus);
129-
} catch (error) {
130-
logger.error("Health check endpoint error", error);
131-
res.status(503).json({
132-
status: "unhealthy",
133-
message: "Health check failed",
134-
timestamp: new Date().toISOString(),
135-
});
136-
}
124+
// Simple, reliable health check for resource-constrained environments
125+
res.status(200).json({ status: "ok" });
137126
});
138127

139128
// Database wake-up endpoint

backend/src/routes/worryResolution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { authenticateToken } from '../middleware/auth';
1313
const router = Router();
1414
const worryResolutionController = new WorryResolutionController();
1515

16-
router.get('/test', (req, res) => res.send('Worry resolution route is working!'));
16+
1717

1818
// Public routes (no authentication required)
1919
router.get('/stories', getPublicResolutionStoriesValidation, worryResolutionController.getPublicResolutionStories);
@@ -27,7 +27,7 @@ router.put('/posts/:postId/resolve', updateResolutionValidation, worryResolution
2727
router.delete('/posts/:postId/resolve', getResolutionValidation, worryResolutionController.unresolveWorry);
2828

2929
// Get resolution data
30-
router.get('/posts/:postId', getResolutionValidation, worryResolutionController.getResolution);
30+
router.get('/posts/:postId', worryResolutionController.getResolution);
3131
router.get('/users/:userId/resolved', getUserResolvedWorriesValidation, worryResolutionController.getUserResolvedWorries);
3232
router.get('/stats', worryResolutionController.getResolutionStats);
3333

backend/src/services/healthCheck.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class HealthCheckService {
163163
});
164164

165165
// Log warnings for concerning metrics
166-
if (metrics.memoryUsage.usagePercent > 95) {
166+
if (metrics.memoryUsage.usagePercent > 80) {
167167
logger.warn('High memory usage detected', {
168168
correlationId,
169169
memoryUsage: metrics.memoryUsage,

0 commit comments

Comments
 (0)