logging the frontend loop
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 11m55s

This commit is contained in:
2025-12-30 23:28:38 -08:00
parent 458588a6e7
commit 38eb810e7a
8 changed files with 51 additions and 15 deletions

View File

@@ -19,6 +19,12 @@ router.get(
validateRequest(emptySchema),
async (req: Request, res: Response, next: NextFunction) => {
try {
// LOGGING: Track how often this heavy DB call is actually made vs served from cache
req.log.info('Fetching master items list from database...');
// Optimization: This list changes rarely. Instruct clients to cache it for 1 hour (3600s).
res.set('Cache-Control', 'public, max-age=3600');
const masterItems = await db.personalizationRepo.getAllMasterItems(req.log);
res.json(masterItems);
} catch (error) {